Using BuddyPress avatars in other themes

Greetings,

I'm using a different theme on our WP multisite install (3.0) that has been made BuddyPress compatible with the BuddyPress Compatible plugin.

BuddyPress has also been activated network wide.

I noticed in reference to comments on the blog that the BP avatar it doesn't use my BP avatar icon - just the default BP one that shows an invisible man:

http://beta.infusionsports.com/2010/06/03/meet-urban-the-2nd/#comment-2

The URL reference for the image is http://beta.infusionsports.com/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg

Also, the author avatar (same person - me!) is not displaying my BP avatar either.

What do I need to tweak this?

Thanks,
Ray

  • Tammie

    @Solari: Are you using the compatible plugin as you have a theme custom made you wanted to use? My advice always would be don't use that plugin and go with a buddypress built theme everytime for exactly these reasons amongst others. It is all personal but I've also had bad experiences supporting that plugin.

    The code you want to be adding into your post loops is:

    <?php echo get_avatar($author_email,'32'); ?>

    or


    <?php echo get_avatar( get_the_author_meta( 'user_email' ), '50' ); ?>
    <p><?php printf( __( 'by %s', 'buddypress'), bp_core_get_userlink( $post->post_author ) ) ?></p>

    But, please consider a) I don't know your theme, b) I don't know your set up and c) I've not tested this so it's just theory currently.

    You can also try using the code in sidebar.php for login.

  • Solari

    Thanks, Tammie. I'll check that out...

    I wonder if it might make more sense to do this in functions.php somehow so the templates don't have to be edited?

    Like in this case we used for being able to insert guest author names without needing to edit a template.

    9. Rewrite Guest Author’s Name with Custom Fields

    Now many blogs are publishing other authors also known as guest authors. A lot of these guest authors are one time writers. In this scenario, it is not feasible to create user accounts for them. This trick will let you replace the author name to guest author with the use of a custom field. Simply paste the code below:

    add_filter( 'the_author', 'guest_author_name' );
    add_filter( 'get_the_author_display_name', 'guest_author_name' );

    function guest_author_name( $name ) {
    global $post;

    $author = get_post_meta( $post->ID, 'guest-author', true );

    if ( $author )
    $name = $author;

    return $name;
    }

    Ray

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.