Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add friend button disappears because of bp_has_members() loop


  • N33D
    Participant

    @n33d

    Hi there,

    On a profile I have a separate element to get the cover image for a member. For some reason because of the code below the “Add friend” and “Public Message” buttons disappear. When I remove only this code and reload the page, the buttons are there.

    Anybody an idea why this code is in conflict with those buttons?

            <?php if (bp_has_members()) : ?>
            
            <?php while (bp_members()) : bp_the_member();?>
            
                <?php // Get the Cover Image
                    $member_cover_image_url = bp_attachments_get_attachment('url', array(
                    'object_dir' => 'members',
                    'item_id' => bp_displayed_user_id(),
                    ));
                ?>
            
                <img src="<?php echo $member_cover_image_url; ?>">
            
            <?php endwhile; ?>
            
            <?php endif; ?>
Viewing 1 replies (of 1 total)

  • N33D
    Participant

    @n33d

    Well, it turns out it has something to do with the do_action( 'bp_member_header_actions' ); action. That one breaks when the code above is active. Still don’t understand why.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar