Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_has_members() function parameters

  • @susivegan

    Participant

    I need to have a members list in members directory (and so in profile search results for which I’m using BP Profile Search plugin) ordered by “popular”. I din’t find any plugin to do it. But I had a look at http://codex.buddypress.org/developer/developer-docs/loops-reference/the-members-loop/ and I see:

    Accepted Parameters
    The bp_has_members() function will accept a number of parameters that will manipulate the data being returned.
    type optional – Defines the type of users to return.
    Accepted arguments: active, newest, popular, online, alphabetical, random
    Default value: active

    So I think that I have to add “popular” to default types (last active, latest registered) and set it as default value.
    I don’t know PHP, just HTML, so I really don’t Know what I have to Write and where.
    Could anybody help me please?
    It would be really very important to me!
    Thank you very much!
    I’m using WordPress 3.4.2 and Buddypress 1.5.6

Viewing 3 replies - 1 through 3 (of 3 total)
  • @modemlooper

    Moderator

    if( bp_has_activities( 'type=popular' ) )

    @susivegan

    Participant

    Thank you so much, I’m going to try and put this line at the beginning of members-loop.php inside Buddypress default theme folder:

    <?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) ) ) : ?>

    which become

    Is it correct?
    Do I have to do something in the function.php file too?

    Thank you very much, I still have to learn everything!

    Susanna

    @susivegan

    Participant

    I tried to change members.loop in default theme (I?m using BP Column)
    I substituted this string

    with this
    if( bp_has_members( ‘type=popular’ ) )
    but when I lokked at the site and tried to have All members page it restituted me this error:
    Parse error: syntax error, unexpected T_ELSE in /home/terrenoi/public_html/quelchecivuole.it/wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php on line 105

    Maybe I have to put this string somewhere else?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘bp_has_members() function parameters’ is closed to new replies.
Skip to toolbar