Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   Howto: add an Avatar to all Posts (http://forum.bytesforall.com/showthread.php?t=15592)

Stevieboy Oct 7, 2011 11:51 AM

Howto: add an Avatar to all Posts
 
With the newer versions of Atahualpa you can't have PHP code in the ATO --> Post Info Items.

So, this took me a few minutes to work out, in ATO --> Add HTML/CSS Inserts --> CSS Inserts

Add the following (and style as you see fit).

Code:

.avatar-64{
padding: 5px 5px 5px 5px !important;
border: solid 4px #eee !important;
margin: 10px 10px 0px 0px !important;
}

Then edit index.php, and add the following line indicated in Bold between the two existing lines.

Code:

if ( function_exists('post_class') ) { ?>
<?php if (!is_page()) {echo get_avatar( get_the_author_email(),'64' );} ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class(); } ?> id="post-<?php the_ID(); ?>">

Of course make sure your Avatars are enabled.

Credits to JuggleDad for the php line that I found in one of his earlier earlier posts.

Hope it's useful so someone.


All times are GMT -6. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.