Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_has_members returns ”no members found” on profile pages.


  • Tijmen Smit
    Participant

    @tijmensmit

    Hi,

    Since I would like to give the recently Active Member Avatars a fixed position, I hard coded it into the sidebar with the following code.

    edit, can’t seem to be able to post php/html code in this screen? Can someone please tell me how to normally past html/php code in the post without it messing it up completely. I tried , [html][/html] between ‘. It all doesn’t work and half of code that I post just vanishes.

    if ( bp_has_members(‘type=active&max=16’) ) : ?>

    No members found.

    I placed the code in a text file and put in on a server. http://tijmensmit.com/code.txt This is what the above code should look like 🙂

    This works fine on every pages, except for the profile page of members (like this page http://buddypress.org/community/members/tijmensmit/). On that page it always says “No members found”. Since I made a custom theme, I thought I must have broken something. But when I tried the default theme that comes with BP and put the above code in the sidebar.php. The same things happens? When I try to add it through the widget menu it does work fine, but I don’t want users to be able to modify the sidebar so it has to be hardcoded.

    Does anyone have any idea why this could happen, and how this could be fixed? Its really just the profile page where it fails?
    Thanks :)[code][/code], [html][/html] between ‘. It all doesn’t work and half of code that I post just vanishes.

    if ( bp_has_members(‘type=active&max=16’) ) : ?>

    No members found.

    I placed the code in a text file and put in on a server. http://tijmensmit.com/code.txt This is what the above code should look like :)

    This works fine on every pages, except for the profile page of members (like this page http://buddypress.org/community/members/tijmensmit/). On that page it always says “No members found”. Since I made a custom theme, I thought I must have broken something. But when I tried the default theme that comes with BP and put the above code in the sidebar.php. The same things happens? When I try to add it through the widget menu it does work fine, but I don’t want users to be able to modify the sidebar so it has to be hardcoded.

    Does anyone have any idea why this could happen, and how this could be fixed? Its really just the profile page where it fails?
    Thanks :)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi timensmit, have you found a solution for this problem?
    i’ve got the same and its driving me crazy!!!


    kelly weaver
    Participant

    @mindfulldesign

    I’m having the same problem. I was able to fix the problem in order to display site-wide groups in the footer of a profile page, but it did not work for displaying members. Below is the code that worked to show groups:
    `<?php $args = array(
    ‘type’ => ‘random’,
    ‘user_id’ => ‘false’
    );
    if ( bp_has_groups( $args) ) : ?>` …

    The codex says you can set user_id to “false”, but it hasn’t worked for me. If the profile you are viewing has no friend connections, no members appear?
    https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-members-loop/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘bp_has_members returns ”no members found” on profile pages.’ is closed to new replies.
Skip to toolbar