hccdev
Veteran
Just Getting Started
Member Likes (0)
I am running BuddyPress 1.5.6 and the members directory lists the 17 recently active users by default. I want it to list all of my users in alphabetical order by default. It would be ideal if they could be alphabetized by last name too.
I replaced this line of code in my members-loop.php of buddypress:
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
with this:
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ),'type=alphabetical') ) : ?>
but it did not work...
Any help would be appreciated.

Responses (12)
Inactive (joined February 2012) Likes (0)
Hey @hccdev
Welcome to the Community!
I think this is the way to do it:
<?php if ( bp_has_members(bp_ajax_querystring( 'members').'&type=alphabetical') ) : ?>This should work. Good luck!
Inactive (joined February 2012) Likes (0)
I hope that worked, Cheers!
Member (joined December 2011) Likes (0)
That code won't order them by last name though, will it? How do we get them to sort in alphabetical order by last name?
Member (joined December 2011) Likes (0)
Anyone?
Member (joined October 2010) Likes (1)Liked by: 
In the Template-File members-loop-php insert the following Code at the top of the file:
<?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */ ?>
<?php do_action( 'bp_before_members_loop' ) ?>
<?php
if ( bp_ajax_querystring( 'members' ) =="")
{
$queryString = "type=alphabetical&action=alphabetical&page=1";
}
else {
$queryString = bp_ajax_querystring( 'members' );
}
?>
<?php if ( bp_has_members( $queryString) ) : ?>
Member (joined December 2011) Likes (0)
That didn't work.
Member (joined October 2010) Likes (0)
maybe this widget will work http://buddydev.com/plugins/buddypress-members-with-uploaded-avatars-widget/
says it can do alphabetically
Support Zombie (joined January 2012) Likes (0)
Hiya, just going through some of the older threads here.
As it's been a little while since we last heard from you I thought I'd check in to see how you're going?
If you're still looking for some further assistance with this thread then please feel free to reopen the thread or of course for any new and related issues you are most welcome to open a new thread.
Cheers!
Tom
Member (joined December 2011) Likes (0)
Hi, I have one of my devs looking into this further, but as of right now we haven't solved the issue in my original post.
Support Zombie (joined January 2012) Likes (0)
@hccdev
Thanks for letting us know, when you are ready to move forward let us know, in the mean time i will also dig into this and see if i can find something for you.
Cheers
Tom
People Person (joined February 2012) Likes (0)
Going to move this to Feature Request for the Developer to consider!
Cheers!
People Person (joined February 2012) Likes (0)
Oops! Re-read the post title, you mean BuddyPress and not the Members Directory as attached to the post here! Sorry.
Try this:
http://premium.wpmudev.org/forums/topic/sort-by-buddypress-users-last-name
Become a member