Title: conditionalizing the_author function
Last modified: August 19, 2016

---

# conditionalizing the_author function

 *  Resolved [Gouri](https://wordpress.org/support/users/gouri/)
 * (@gouri)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/conditionalizing-the_author-function/)
 * Mine is a single author blog [http://www.ezaroorat.com](http://www.ezaroorat.com)
   I want to introduce guest posts on it. But I do not want the guest author to 
   be registered in the admin panel. On the guest posts, I want to hide my (default
   author) name. Is it possible to conditionalize the_author function so that the
   author name is hidden on guest posts only but displayed on all other posts? (
   By imposing some kind of conditions based on tag or custom field).

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/conditionalizing-the_author-function/#post-1214122)
 * For use in [The Loop](http://codex.wordpress.org/The_Loop):
 *     ```
       <?php
       //if guest_author custom field is present don't display the author.
       $guest_author = get_post_meta($post->ID, 'guest_author', true);
       if (!$guest_author){
       the_author();
       }
       ?>
       ```
   
 *  Thread Starter [Gouri](https://wordpress.org/support/users/gouri/)
 * (@gouri)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/conditionalizing-the_author-function/#post-1214200)
 * That’s really great!! MichaelH, thank you so much. I have implemented it & am
   now ready to take my flight.

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

The topic ‘conditionalizing the_author function’ is closed to new replies.

## Tags

 * [author](https://wordpress.org/support/topic-tag/author/)
 * [guest](https://wordpress.org/support/topic-tag/guest/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Gouri](https://wordpress.org/support/users/gouri/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/conditionalizing-the_author-function/#post-1214200)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
