WordPress.org

Forums

Hiding Admin Public Meta Data (3 posts)

  1. Sebastien Sanz de Santamaria
    Member
    Posted 2 years ago #

    I post author meta data (name, description, url, etc.. ) on a single post template, for a member based listing site.

    While most of the generated posts are by members, some are made by the admin.. and as such I would like to hide the meta data when a post's author is admin.

    currently this is outside the loop in my single.php template

    <?php
        $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
        ?>
    <?php echo $curauth->user_nicename; ?>
    <?php echo $curauth->user_description; ?>
    <?php echo $curauth->user_url; ?>

    how can I edit this to hide the info when the author is admin?

    I tried looking at running a conditional tags thing, but didn't find anything for single posts.. only author pages.

    any help will be greatly appreciated.

    Thanks

  2. riversatile
    Member
    Posted 2 years ago #

  3. Sebastien Sanz de Santamaria
    Member
    Posted 2 years ago #

    Thanks riversatile,

    very useful article, but from what I understand, its more to determine how a site should behave towards whoever is logged in at the time.

    I'm simply needing to admin meta data of a post.. whether logged in or not

    i'm currently using the code from here: http://wordpress.org/support/topic/hide-author-info-when-admin-post?replies=9

    to hide admin name within the post data inside the loop.

    but I need to hide things outside of loop

Topic Closed

This topic has been closed to new replies.

About this Topic