Support » Plugins » Making Avatars appear on the index page!

  • fabtigger


    I’m creating a blog with multiple authors, so I want to get avatars/gravatars for each user to appear on my index page of my child theme of Twenty Eleven when it displays their post.

    I found that if I edit index.php, I can add the line
    <?php echo get_avatar( $post->post_author, 50 ); ?> Just after the loop, this will sucessfully add an avatar on top of the post. The only problem with this is that it also displays the admins avatar as well. Is there a way to block the admin/specific user’s avatar? below is a larger snippet of the code I use

    <?php if ( have_posts() ) : ?>
    				<?php twentyeleven_content_nav( 'nav-above' ); ?>
    				<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    					<?php echo get_avatar( $post->post_author, 50 ); ?><?php get_template_part( 'content', get_post_format() ); ?>
    				<?php endwhile; ?>
    				<?php twentyeleven_content_nav( 'nav-below' ); ?>
    			<?php else : ?>

    PS: This method makes the avatar appear above the post. Is it possible with css to make the avater float/align left of the post? How woud I do this?

Viewing 1 replies (of 1 total)
  • fabtigger


    Hmmm… I can’t seem to figure this out. Does anyoe know how I can exclude showing the admin avatar with the code above. Or perhaps has a better method of doing what I’m attempting! I’ve search the forums but can’t find any examples.

Viewing 1 replies (of 1 total)
  • The topic ‘Making Avatars appear on the index page!’ is closed to new replies.