Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change the selection option from “Last Active” to “Alphabetical” by default


  • javigandia
    Participant

    @javigandia

    Hello everyone!
    I would like to know if it is possible that on the members home page instead of appearing by default the select option in “Last Active” could be “Alphabetical”.
    Thank you very much in advance.
    Buddypress seems like a great plugin to me.

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

  • Anonymous User 18187419
    Inactive

    @anonymized-18187419

    If you are using BP Nouveau then this code snippet should work:

    function themename_bp_reorder_member_directory_filters( $filters, $context ) {
    	if ( 'group' !== $context ) {
    
    		$filters = array();
    
    		if ( bp_is_active( 'xprofile' ) ) {
    			$filters['alphabetical'] = __( 'Alphabetical', 'buddypress' );
    		}
    
    		$filters['active'] = __( 'Last Active', 'buddypress' );
    		$filters['newest'] = __( 'Newest Registered', 'buddypress' );
    	}
    
    	return $filters;
    }
    add_filter( 'bp_nouveau_get_members_filters', 'themename_bp_reorder_member_directory_filters', 10, 2 );

    javigandia
    Participant

    @javigandia

    Funciona perfectamente muchísimas gracias.


    GCF
    Participant

    @gcf

    he encontrado otros hilos pidiendo esta misma funcionalidad y esta funciona de maravilla. ¡por fin, muchas gracias!


    GCF
    Participant

    @gcf

    sorry, i have tested but i think it only changes default order of options but doesn’t display users alphabetically ordered


    GCF
    Participant

    @gcf

    i said nothing, it was my fault. works like a charm. i was not correctyly updating to nouveau theme


    sbanner26
    Participant

    @sbanner26

    Looking for the same thing. What file do I add this snippet to?


    thinlizzie
    Participant

    @thinlizzie

    sbanner, you can add it to functions.php or add it using Code Snippets plugin.


    sbanner26
    Participant

    @sbanner26

    Thanks @thinlizzie. Worked perfectly adding to functions.php. BTW, love your username!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar