0

I'd like to pull the avatar of a blog post's author and display it on the page using BuddyPress but I cannot seem to pull it off. How would I go about this?

closed as off-topic by Pieter Goosen, cybmeta, birgire, Nicolai, Johannes Pille Nov 19 '14 at 17:29

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • BuddyPress questions are not off-topic. The BuddyPress site is hosted by WP. The BuddyPress trac site is hosted by WP: buddypress.trac.wordpress.org So BP is not a 3rd party plugin. – shanebp Nov 19 '14 at 18:11
0

Try this:

$author_id = get_the_author_meta('ID');
echo bp_core_fetch_avatar ( array( 'item_id' => $author_id, 'type' => 'full' ) ); 

Defaults:

array(
   'item_id'    => false,
   'object'     => 'user',
   'type'       => 'thumb',
   'avatar_dir' => false,
   'width'      => false,
   'height'     => false,
   'class'      => 'avatar',
   'css_id'     => false,
   'alt'        => '',
   'email'      => false,
   'no_grav'    => false,
   'html'       => true,
   'title'      => '',
);
1

Something like this should work:

<?php
    $author = get_the_author_meta('ID');
        echo bp_core_fetch_avatar( array('item_id' => $author ) );
    ?>

Not the answer you're looking for? Browse other questions tagged or ask your own question.