BP Profile Search › Show only 'active' members
-
AuthorPost
-
Ace Suares
GuestHi,
We have 67 members, but [bps_diectory] shows only 7. It calls this ‘active’ members. But when ordering ‘alphabetical’ it shows ALL members. I want is standard to show all members alfabetically. How to do that?
thx
aceandrea
Plugin AuthorHi Ace,
You can force the alphabetical order, but then the other ordering options will stop working.
Open the file members-loop in your custom template, locate the line:
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>and replace it with:
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ). '&type=alphabetical' ) ) : ?>Ace Suares
GuestHi Andrea,
I found that solution on other places in Internet, but it doesn’t work.
As soon as you use a form or the serach box, this ‘alphabetical’ goes away.So, if I had 7 active members and 67 members total, the type=alphabetical showed all 67 when opening the page. But the using ‘search’ or our form (choose language = english for instance) the results only show the active members.
So if I see 67 members and one of them is Andrea, and the I search for Andrea, but that is not one of the 7 active members, then ‘no results’ comes up!
I edited now, buddypress/bp-members/bp-members-template.php
Around line 360: changed ‘active’ to ‘alphabetical’.
Of course this gets overwritten with every update,,, is there another way?// Type: active ( default ) | random | newest | popular | online | alphabetical.
$r = bp_parse_args( $args, array(
‘type’ => ‘alphabetical’,
‘page’ => 1,
‘per_page’ => 20,andrea
Plugin AuthorHi Ace,
I can’t reproduce the issue of the alphabetical order going away after a search.
I suggest you apply that change to a clean index and members-loop template pair and try again. It could be that other changes in your custom templates interfere with the ordering.
Ace Suares
GuestCould you setup a link to a page where the <?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ). ‘&type=alphabetical’ ) ) : ?> is applied? Then I can look for differences.
Thx.
andrea
Plugin AuthorHello Ace,
Setting up a test page that replicates your environment is a time consuming task, and I’m afraid I’m unable to do that. On the other hand, I’m available to debug your page if you set it up in a location I can access.
Please note that the [bps_directory] shortcode is not guaranteed to work well with page builders. Could you try putting the shortcode in an empty page by itself, and see if it works that way?
-
AuthorPost