Group Admins

WordPress Troubleshooting and Support

Public Group active 1 year, 5 months ago ago

WordPress support from our community

Hiding Admin Public Meta Data

Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1600
    residencyunlimited
    Participant

    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 posts are made by the admin.. and as such I would like to hide the meta data when a post’s author is admin.

    currently I use thisoutside the loop in my single.php template

    $curauth = (isset($_GET)) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author));
    ?>
    user_nicename; ?>
    user_description; ?>
    user_url; ?>

    how can I change this to hide the info when the author is admin? I tried looking at running a conditional tags thingy in wp codex, but didn’t find anything for single posts.. only author pages.

    any help will be greatly appreciated.

    Thanks

    #2808
    residencyunlimited
    Participant

    oops code didn’t go in nicely, here’s a paste bin
    http://pastebin.com/raw.php?i=S5qC1mRU

    and also 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 this doesn’t seem to do anything to metadata outside of the loop.

    thanks again anyone for your time.

    #2810
    Steve
    Keymaster

    This article from Stackoverflow seems to have what you are looking for. You just need to pass the author ID to the function. You can grab the ID from $curauth.

    #2811
    residencyunlimited
    Participant

    thanks Steve, will take a look! I have to admit I’m not a coder, so very trial and error prone. I’ll see how far I can get!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.