dmtnexer
dmtnexer

Reputation: 27

Wordpress: Author page PHP If viewing xxxx author page show this xxxxx

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

Answers (2)

Juan Carlos Brown
Juan Carlos Brown

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

Banago
Banago

Reputation: 1420

You need to run the is_author() function like this:

if( is_author('8'); ) {
    echo 'somehthing';
}

Upvotes: 2

Related Questions