Reputation: 27
I'm making custom author pages for a website with 3 authors. The page has a list of posts by the author, bio and social links.
I want to add a special feature that if it is certain's author page, lets say author id 8, it outputs some code. if not, do nothing. can someone please give me some advice on how to perform this conditional php call?
this is to add some information inside the php file with some details of the author.
Upvotes: 0
Views: 751
Reputation: 285
You may refer to the Codex documentation about conditional tags, you may find this specially useful: http://codex.wordpress.org/Conditional_Tags#An_Author_Page
You can use those conditionals inside your author template to display the conditional information you want. In this case wnat you want is something like:
if (is_author( '8' ))
{
//Do something cool
}
Hope it helps.
Upvotes: 0
Reputation: 1420
You need to run the is_author()
function like this:
if( is_author('8'); ) {
echo 'somehthing';
}
Upvotes: 2