Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • @designfirm

    Participant

    Hello again,

    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.

    Scott

    @designfirm

    Participant

    Thanks a lot. I’ll give it a try!

    Scott

    @designfirm

    Participant

    Hi Boone,

    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_page argument 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_page argument, 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:

    socialbuddy/buddypress/
    ajax.php
    functions-buddypress.php
    global.js
    style-buddypress.css

    socialbuddy/members/
    index.php
    members-loop.php
    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.

    Regards,
    Scott

    @designfirm

    Participant

    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[0] == 's2member_level3') || ($user->roles[0] == 's2member_level4') ) : ?>

    As I said, the user query works, but it seems to cause problems with the pagination.

    @designfirm

    Participant

    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’ ) ) : ?>

    to

    <?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&#8221; but clicking the second page still results in “Sorry, no members were found.”

Viewing 5 replies - 1 through 5 (of 5 total)
Skip to toolbar