Check out the tutorial on placing avatars next to a post or page title here. When you do this you’ll get an avatar on every single page you have. Say you want to take the avatar off certain pages. Take the code you have from the function you already created and add the following code in red…
/*removing an avatar from selected pages*/
function author_avatar() {
if (!is_page(304) && !is_page(173))
echo ‘<img src=”http://www.thesishacker.com/wp-content/themes/thesis/custom/images/nastycanasta.jpg” class=”title-avatar” />’;
}
add_action(’thesis_hook_before_headline’, ‘author_avatar’);
Basically you’re taking a simple if (is_page()) statement and adding…
An exlamation point, !, which in PHP makes whatever is in front of it, negative. What you’re doing is saying “if the page isn’t ()”
In the () you put whatever page id you want. You find the page id by going to the page you want and in the address bar it’s the last number in the address. If you go to the tutorial page in this site the URL is ..
http://www.thesishacker.com/?page_id=173
The page id is 173, thus that’s the number I put in the function
Also you need 2 “&” together to say “and” in PHP. I decided to negate two pages, thus I needed the && between the two identifiers











If you would like to leave a comment and you have examples of code you want to show, you must "escape the code". This allows the entire code to show correctly by inserting certain variable around certain tags to make them show. If you don't "escape the code" your code will show up broken, mangled, and it won't be able to be seen correctly. "Escaping the code" is very simple...
Go ahead, leave a comment...