April 9, 2019 at 4:15 pm #9869
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?
aceApril 10, 2019 at 12:50 pm #9873
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' ) ) : ?>April 10, 2019 at 4:27 pm #9874
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,April 10, 2019 at 9:57 pm #9875
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.April 12, 2019 at 12:54 pm #9886
Could 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.April 12, 2019 at 3:07 pm #9891
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?