[resolved] conditionalizing the_author function (3 posts)

  1. Gouri
    Posted 6 years ago #

    Mine is a single author blog 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).

  2. MichaelH
    Posted 6 years ago #

    For use in The Loop:

    //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){
  3. Gouri
    Posted 6 years ago #

    That's really great!! MichaelH, thank you so much. I have implemented it & am now ready to take my flight.

Topic Closed

This topic has been closed to new replies.

About this Topic