Title: current author condition
Last modified: August 19, 2016

---

# current author condition

 *  [Wisse](https://wordpress.org/support/users/prodi41/)
 * (@prodi41)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/current-author-condition/)
 * Hello I would like to add an icon to every post of one specific author. I can’t
   find the conditional tag for checking if the current post in the loop is written
   by a specific author. So I would like:
 *     ```
       if (?current_author?='authorname') {
            <code>
       }
       ```
   
 * Thanks for the help =D

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/current-author-condition/#post-1191438)
 * [is_author()](http://codex.wordpress.org/Conditional_Tags)
 *  Thread Starter [Wisse](https://wordpress.org/support/users/prodi41/)
 * (@prodi41)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/current-author-condition/#post-1191474)
 * I thought that one was only for checking if the current page is an author page.
   I’m talking about the current post being written by a specific author. Or does
   is_author() also work like that?
 * Thanks!
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/current-author-condition/#post-1191480)
 * The $post variable within the Loop always contains a post_author element. So `
   if (<author_id> == $post->post_author) { ... }` should do it. You’ll have to 
   switch on the author id, not the author name, so use [get_userdatabylogin to get the ID from the name](http://wordpress.org/support/topic/226466?replies=9).
 *  Thread Starter [Wisse](https://wordpress.org/support/users/prodi41/)
 * (@prodi41)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/current-author-condition/#post-1191484)
 * Thanks for that! I will try it out!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘current author condition’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [Wisse](https://wordpress.org/support/users/prodi41/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/current-author-condition/#post-1191484)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
