• Hello, great plugin. I am trying to display the image cover on each user in member-loop. It would be great if you can help me.

    Here is my code

    <?php // Get the Cover Image
    	$member_cover_image_url = bp_attachments_get_attachment('url', array(
    	    'object_dir' => 'members',
    	    'item_id' =>  bp_get_member_user_id(),
    	));
    ?>
    <img src="<?php echo $member_cover_image_url; ?>">
    

    This code work but only with default buddypress cover image, not with your plugin.
    Thank you very much

Viewing 1 replies (of 1 total)
  • Plugin Author aghajoon

    (@aghajoon)

    Hi you can try this code

    <?php // Get the Cover Image
        if ( bp_displayed_user_use_cover_image_header() ) {
    	$member_cover_image_url = bp_attachments_get_attachment('url', array(
    	    'object_dir' => 'members',
    	    'item_id' =>  bp_get_member_user_id(),
    	));
    	}else{
    	$member_cover_image_url=get_user_meta(bp_get_member_user_id(), 'bp_cover', true);		
    				}
    ?>
    <img src="<?php echo $member_cover_image_url; ?>">
    • This reply was modified 7 years, 10 months ago by aghajoon.
    • This reply was modified 7 years, 10 months ago by aghajoon.
Viewing 1 replies (of 1 total)
  • The topic ‘how to show image cover in member-loop?’ is closed to new replies.