BuddyDev

Search

[Resolved] Echo buddypress profile header contents in sidebar

Tagged: 

  • Participant
    Level: Initiated
    Posts: 1
    james on #3646

    Hello, im really struggling to find anything on this and was wondering if you could help me. Bascally what I am looking to do is echo the profile user link, most recent activty and the cover image in my themes sidebar for my activity page. but what ever I try I just cannot get the cover image to echo out.

    what I am doing at the moment is using

    add_filter(‘bp_displayed_user_id’,’bp_displayed_outside_bp’);
    function bp_displayed_outside_bp($id){
    return ($id==0) ? get_current_user_id() : $id;

    and then dumping all of the cover-image-header.php where I want my profile box to be which does echo out everything I want except for the cover image (which is probably the wrong way of doing things).

    Help would be great.. and a internet first because nobody seems to have an answer.

    thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #3647

    Hi James,
    Welcome to BuddyDev.

    You can use the following function to get the image url like this

    
    
    $image_url = bp_attachments_get_attachment('url', array( 'item_id' => bp_displayed_user_id() ) );
    
    

    Try using it and let me know if it helps or not?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 1
    james on #3649

    Thank you!!!! this is awesome! I’m going to recommend this site from now on to people!

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #3652

    Hi James,
    Thank you for the kind words. I am glad we were able to help.
    All the best with your project.

    Regards
    Brajesh

The topic ‘ [Resolved] Echo buddypress profile header contents in sidebar’ is closed to new replies.

This topic is: resolved