Support » Fixing WordPress » conditionalizing the_author function

  • Resolved Gouri

    (@gouri)


    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).

Viewing 2 replies - 1 through 2 (of 2 total)
  • For use in 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();
    }
    ?>

    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.