Skip to:

[Resolved] Make members list default to alphabetical

  • Bruce


    I want to make the members list page default to an alphabetical sort.
    I’ve searched through BuddyPress forums and tried a couple things suggested in the past, but they didn’t work.
    I’m using BuddyPress Version 2.0.2 in WordPress 2014 theme.
    I don’t know much php, so if you have the answer, I need to be told where exactly to insert or edit any code.

    Would greatly appreciate any help.


Viewing 3 replies - 1 through 3 (of 3 total)

  • danbp


    Hi @bnowthen,

    this is one of the most common thing you can do with BuddyPress. 😉 .
    To do that, you have to read the Codex, about members loop.

    First, you will create a child-theme of 2014.
    Than you add a folder called buddypress to it.
    In this folder, you add a sub folder called members.
    You than make a copy of members-loop.php.
    This file is in wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/

    Now, you open the copied file and replace the content of line 16.

    Replace this:
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
    with this:
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) . '&type=alphabetical' ) ) : ?>

    Save and enjoy.


    Members Loop



    Thanks, but I have one correction for those not familiar with php. Delete the comment “//” marks just before the “if” statement, or you come up with no list at all.

    So <?php //if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘&type=alphabetical’ ) ) : ?>

    Should be:

    <?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘&type=alphabetical’ ) ) : ?>

    Thanks again. This was very helpful, especially the instruction to put the buddypress code in the child theme folder.



    You’re welcome, and thank you for the advice. I corrected the snippet accordingly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Make members list default to alphabetical’ is closed to new replies.
Skip to toolbar