I´m trying to insert adsense code depending on the user who created the entry...but for any reason, with the bridge enabled, the conditional doesn´t work. Please check this: Code: <?php if(is_author('author1')){ ?> CODE <?php } elseif(is_author('Author2')){ ?> CODE <?php } elseif(is_author('Author3')){ ?> CODE <?php } ?> What am I doing wrong?
You shouldn't use is_author if at all possible. In what context are you putting this code? Where exactly is it going (file etc)?
I use this code on Single.php and the code I want to show are Google ads depending on the user who created the entry.
My suggestion would be to find the part in your current template that actually displays the author's name, take that variable and use that for your conditional. That way you know it's sure to work.
It depends on how your template is set up and the context it's in, but you could, for example, try using PHP: get_the_author() to get the name of the author
I can't possibly guess at it without seeing the template. If you want me to have a look properly then talk to me on MSN at some point, but this isn't really core functionality.
wordpress will deterimine who is entry author, try compare names eg; PHP: $currentuser = get_currentuserinfo();if ( get_the_author() == $currentuser->displayname ) { // current user is the post author; do something}