Showing avatars without buddypress installed

On the Studio theme, how can I show a users avatar on the main blog page without having buddypress installed?

i've seemed to figure out how to do it for an actual post, but not the main post listings (blog page).


  • bbaer

    ugh.. I finally figured this out after 4 hours of trial and error... I'm not a coding export.

    Your code wasn't helpful, I already knew this code as evident from my figuring out how to get an avatar on an individual blog post.

    For those using Studio WITHOUT buddypress, and want to show an avatar of the user posting, here is what you need to do:

    Find loop-functions.php (You do not edit the individual template files like you do for most other templates)

    in loop-functions.php you'll see two sections,
    /* buddypress function */
    /* non buddypress loop functions */

    You'll obviously want to edit the section NON BUDDYPRESS. here is my code.. Your indiv. requirements may vary.

    /* non buddypress loop functions */
    function wpmu_blogpage_loop(){
    		$page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=&showposts=5&paged=$page"); while ( have_posts() ) : the_post();?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<div class="author-box">
    				<?php echo get_avatar( get_the_author_meta( 'user_email' ), '60' ); ?>
    				<p><?php _e( 'by ', 'studio' ) ?><?php the_author_link();  ?></p>
    			<div class="post-content-wp">
    				<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'studio' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    					<p class="date"><span class="byline"><?php the_time('M j Y') ?> <?php _e( 'in', 'studio' ) ?> <?php the_category(', ') ?> <em><?php _e( 'by ', 'studio' ) ?><?php the_author_link();  ?></em></span></p>
    						<div class="entry">
    									<a href="<?php the_permalink() ?>">
    										<?php if(function_exists('the_post_thumbnail')) { ?><?php if(get_the_post_thumbnail() != "") { ?><div class="alignleft">
    										<?php the_post_thumbnail(); ?></div><?php } } ?>
    							<?php the_excerpt(); ?>
    				<p class="postmetadata"><span class="tags"><?php the_tags( __( 'Tags: ', 'studio' ), ', ', '<br />'); ?></span> <span class="comments"><?php comments_popup_link( __( 'No Comments »', 'studio' ), __( '1 Comment »', 'studio' ), __( '% Comments »', 'studio' ) ); ?></span></p>
    			<?php endwhile;
    add_action('wpmu_blogpageloop', 'wpmu_blogpage_loop');

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.