Try:
<?php if(is_page()) echo get_avatar( get_the_author_email(), '50' ); ?>
Hi Esmi,
Thanks for your help but that shows pic on page and not posts whereas I’d like it the other way round (pic showing on posts, not pages)
I tried changing what you gave me to:
<?php if(is_post()) echo get_avatar( get_the_author_email(), ’50’ ); ?>
and then ..
<?php if(is_not_page()) echo get_avatar( get_the_author_email(), ’50’ ); ?>
followed by ..
<?php if(is_post()) echo get_avatar( get_the_author_email(), ’50’ ); ?>
and …
<?php if(have_post()) echo get_avatar( get_the_author_email(), ’50’ ); ?>
but all gave errors saying:
Fatal error: Call to undefined function is_post() in /home/custard/public_html/giveabrick/wp-content/themes/atahualpa/index.php on line 14
So next question I guess is what function do I need instead of ‘is_page to get the pic showing on posts not pages?
Many thanks for your help and patience,
Eleanor
Hi,
I wasn’t sure where to put that (sorry, I’m brand new to this) but your link to the conditional tags page was brilliant because I’ve found this to work:
<?php if(is_home()) echo get_avatar( get_the_author_email(), ’50’ ); ?>
<?php if(is_single()) echo get_avatar( get_the_author_email(), ’50’ ); ?>
Without that page you showed me, I would never have known what to put for a post and using the (is_home) allows author pics to show on main page as well as single post pages.
Someone cleverer than me will have a neater way to do this but I’m just delighted because it’s doing what I want it to so thank you ever so much for helping me.
Eleanor