Forum Replies Created
The query you wrote worked, but I can’t figure out how to get the search field and orderby filter to only re-query the two roles I’m initially querying by.
Is there an easy way to do this?
Sorry, I tried to make sense of how this stuff works, but anything beyond slight modifications is beyond me at this point.
Thanks for any help you can provide.
Thanks for the response. The “no-ajax” class did load users on subsequent pages, but I’m still experiencing other odd behavior:
If I have the
&per_pageargument like this: `
<?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘&page_arg=bapage&per_page=10’ ) ) : ?>` I receive no members on the first page, and two members on the second page if the filter is set to “newest registered” or “last active”. If it’s set to “alphabetical”, one member shows up on the first page, none on the second page, and one on the third page.
If I remove the
&per_pageargument, I get both members on the first page for “newest registered” and “last active.” For “alphabetical”, I get one member on the first page, and one on the second.
I’m using the social buddy theme. It’s set up like this:
single/(a bunch of files)
I’ve added bloggers.php, which is a modified members’ index.php that I’m using as my page template, to the main “socialbuddy” folder. I changed the
locate_template()function so that it uses my modified members-loop: members-loop-bloggers.php, which I’ve placed in the “members” folder.
Thanks for any insight you can provide.
Perhaps more code would help?
<?php if ( bp_has_members( 'page_arg=bpage&per_page=3' . bp_ajax_querystring( 'members' ) ) ) : ?> <?php do_action( 'bp_before_directory_members_list' ); ?> <ul id="members-list" class="item-list" role="main"> <?php while ( bp_members() ) : bp_the_member(); $user = new WP_User( bp_get_member_user_id() ); if ( ($user->roles == 's2member_level3') || ($user->roles == 's2member_level4') ) : ?>
As I said, the user query works, but it seems to cause problems with the pagination.
After searching a little more, I found the ‘page_arg’ argument in bp-members-template.php. The url in the file directed me to here.
Following the example there, I changed <?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘per_page=2’ ) ) : ?>
<?php if ( bp_has_members( ‘page_arg=bpage&per_page=2’ . bp_ajax_querystring( ‘members’ ) ) ) : ?>
That did change the URL of the pagination to “http://localhost/twopointohla/bloggers-directory/?bpage=2” but clicking the second page still results in “Sorry, no members were found.”