How can I display a div box with ID only for the corresponding author of the wordpress page?
for example
when testuser is logged in he should see a div box with id="author" inside his post (post/test2/).
but
if another user is logged in he should not see the div box with id="author" within the post (post/test2/).
Is there a possibility? Unfortunately I’m a beginner and don’t know how best to approach the problem.
2
Answers
i made it for the admin but i want the id to be visible only to the author of the post.
example:
if the author is logged in he should see the content with the id=author.
but
if another user is logged in he should not see the content with the id.
Although, your question is not so clear about your requirements. What I understood is you are looking for an Author box on the post, in the standard WordPress theme hierarchy it is called Single, and the file is single.php
You can try by adding div conditionally checking for the post author.
If that is not the solution you are looking for, please share some code samples you are working on with a better explanation.