Skip to:
Content
Pages
Categories
Search
Top
Bottom

Syntax for search_terms in bp_has_site_members


  • philbow
    Participant

    @philbow

    I’m trying to create a specialized search result page based on a music genre. I’m currently using the following code but it returns all users:

    <?php if ( bp_has_site_members( 'search_terms=metal&per_page=10' ) ) : ?>

    Is this the correct syntax, or what am I missing?

    Thanks,

    Phil

Viewing 4 replies - 1 through 4 (of 4 total)

  • Jeff Sayre
    Participant

    @jeffsayre

    Which version of BuddyPress are you running? The current version of BP does not have that function. Instead, it is bp_has_members().

    Having you been developing under an older version and then you upgraded? Codebase changes are to be expected. The first thing to do when previously working code fails is to check the logs, they will often indicate the issue. Then, if you need to sleuth some more, check the core functions to see if something has changed–the function name, function parameters, or both.


    philbow
    Participant

    @philbow

    I’m running 1.1.2, and it has not been upgraded.

    Thanks


    Felipe Navarro V.
    Participant

    @konus

    Running 1.2.3 using:

    <?php if ( bp_has_members( 'search_terms=metal&per_page=10' ) ) : ?>

    Doesn’t work! :(


    Felipe Navarro V.
    Participant

    @konus

    The plugin bp-member-filter[1] works for me.

    You need to use :

    <?php if ( bp_has_members_filter( 'search_terms=metal&per_page=10' ) ) : ?>

    [1] https://wordpress.org/extend/plugins/bp-member-filter

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Syntax for search_terms in bp_has_site_members’ is closed to new replies.
Skip to toolbar