Hi there,
You can do that with the user’s username, email or ID. Any of these examples will do:
[hide for="username:{post_author_username}"]Lorem ipsum dolor sit amet.[/hide]
[hide for="useremail:{post_author_email}"]Lorem ipsum dolor sit amet.[/hide]
[hide for="userid:{post_author_ID}"]Lorem ipsum dolor sit amet.[/hide]
Hope this helps.
Best.
Andrés.
Hi Andrés,
I tried this:[hide for=”userid:{post_author_ID}”]Lorem ipsum dolor sit amet.[/hide], but it didn’t work for me.
And I tried the hide alone:[hide]Lorem ipsum dolor sit amet.[/hide]
And that works fine, but the:
[hide for=”userid:{post_author_ID}”]Lorem ipsum dolor sit amet.[/hide] doesn’t.
I deactivate all my plugins to make sure it wasn’t a conflict, do you think its maybe missing something?
Are you replacing {post_author_ID} with the actual numeric ID of the post author? If that’s not the case, you can find the ID by going to the list of users. Once there hover on the user’s name and look at the number that appears in the URL after ?user_id=.
No, I wasn’t replacing it.
I want it to hide it for all post authors, for example if there is post author a, and post author b.
Hide post author’s a posts from itself, but that he is able to see post authors b posts, and viceversa.
So you don’t want authors to see their own posts? If that’s the case, any of the above examples will work. Just remember to use replace the placeholders ({post_author_ID}, {post_author_email}, {post_author_username}) with the actual values.