I have this specific tag I need to assign to my posts but I need to hide it from regular visitors so that only logged in people can see it. How do I go about it? What WordPress function/hook should I be looking into?
I know that I could use is_user_logged_in()
and I am also looking into is_tag()
, but how do I put this together? Currently I’m having it displayed in my single template with the_tags()
, but it doesn’t seem to offer a parameter to exclude a particular tag.
Pseudo code would be: if user is logged in then show all tags except a specific tag.
Add the
add_filter
to your theme’sfunctions.php
file