Welcome to BuddyDress

Our themes show off your site’s content - and do it well. We look for inspiration all around us - introducing personality for a dramatic effect that will bring your content to life.

Founded on the idea that your site should be exceptional in style and quality, we draw on classic design techniques to present a beautiful and unique collection of themes at an excellent value.

remember me
  

Showing profile’s avatar and link in comments

avatar1Today i’ll show a little trick to better integrate your WordPressMU blogs with your BuddyPress. It is really easy, but could be useful for buddypressers that are no confident with php and html.

Are you actually using Gravatar for showing user avatars in the comments of your blogs? This could be not a great affair, because your comment avatars could result different from your registered user profile avatars.

If you want to show in the comments the avatars that users have uploaded in your buddypress profile, first of all you should disable Gravatar plugin. Then open the comments.php page of your theme (not buddypress theme, but your blog’s theme) and add the following line where you want to show your avatars:

<?php bp_comment_author_avatar() ?>

I’ve inserted this line just after:

<li class=”<?php echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”>

and before of :

<cite><a href=”<?php comment_author_url() ?>”><?php comment_author_link() ?></a></cite> says:

Obviously not all the comment.php pages are the same cause themes are different, but they are similar and so watching your code you should easily understand where to insert the line. They go in the foreach loop, just after the ”<li>” tag opening.

In your original code, the commenters name are linked to the website url that they have inserted in WordPressMU. If you want to link them to their Buddy Press profile in your site, just change this:

<cite><a href=”<?php comment_author_url() ?>”><?php comment_author_link() ?></a></cite> says:

into this:

<?php comment_author_link() ?> <?php _e( ‘says:’, ‘buddypress’ ) ?>

Now the commenter’s name will be linked to his buddypress profile page. Not registered usernames will be linked to the website they’ve inserted in the comment url field, and their avatar will be the classical Mistery Man.

Ps: you can recognize AndyPeatling (the Buddy Press creator) in the post image: this man is everywhere!

Comments : 5

  1. Promo code all slots…

    Promo code all slots…

  2. Free bonus on line slots…

    Free bonus on line slots…

  3. $2000 no deposit bonus casino…

    $2000 no deposit bonus casino…

  4. Casinos new player sign up bonus…

    Casinos new player sign up bonus…

  5. Casino free bonus…

    Casino free bonus…

  6. No deposit bonus action poker…

    No deposit bonus action poker…

  7. Play wms slots online…

    Play wms slots online…

  8. Nodepositneeded…

    Nodepositneeded…

  9. Casino bonus code list…

    Casino bonus code list…

  10. Casino 1238991660…

    Casino 1238991660…

  11. Sgrunt says:

    ok Andy and thank, i’m sure nobody knows Buddy Press better than his creator!

  12. Andy P says:

    The get_gravtar() call will automatically show their BuddyPress avatar, if they have one set.

  13. snmjmomyriy says:

    r14DeS tjxdgdnpsfcs, [url=http://dfsaidambxfp.com/]dfsaidambxfp[/url], [link=http://xjhlwatzpusl.com/]xjhlwatzpusl[/link], http://nyeamhjbfhby.com/

  14. Sgrunt says:

    Thanx Andy, i’m not a programmer and my code tutorials could seem funny for experts. But i assure you that i have had to hack my theme (obviously i’m not talking about buddy press themes here) for link my comments to my profile page. The Gravatar should show their gravatar, that could be different from their buddypress profile avatar, or am i wrong?

  15. Andy P says:

    the_gravatar() will also show the users’ BuddyPress avatar if they are logged in when they comment. Their link will also turn to their profile link if they are logged in too.

1 2 3 67

Leave a Reply


Showing profile’s avatar and link in comments

991 Trackbacks