Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to access Buddypress avatar not on profile page

  • Hi I am developing a new site for a client. I’m trying to crate a sidebar for logged in users with their avatar, username, notifications and the Buddypress pages. I’m trying to add the avatar with the code below:

    <?php
    $userid = bp_loggedin_user_id();
    $avatarurl = bp_core_fetch_avatar( array( ‘item_id’ => $userid, ‘html’ => false ) );
    echo $avatarurl;
    ?>

    This works on Buddypress profile page but no other page, is there anything I need to include in the header. This is a personal theme not the Buddypress default. I’m using WordPress 3.8.1 and Buddypress 1.9.2. The site is beta.hyperjake.com

    Thanks for your help
    Conor

Viewing 2 replies - 1 through 2 (of 2 total)

  • Henry Wright
    Moderator

    @henrywright

    Hi

    Try:

    echo bp_core_fetch_avatar( array( 
        'alt' => 'Profile picture of ' . bp_get_loggedin_user_fullname(),
        'class' => 'avatar', 
        'width' => 50, 
        'height' => 50, 
        'item_id' => bp_loggedin_user_id(), 
        'type' => 'full', 
        'title'=> bp_get_loggedin_user_fullname()
    ) );

    Great that worked.

    Thank you so much 🙂

    Conor

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to access Buddypress avatar not on profile page’ is closed to new replies.
Skip to toolbar