Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display more than 20 members per page


  • dolf h
    Participant

    @dolf-h

    Hi there! I ‘m trying to change the number of members per page. I changed the bp-members-template.php from 20 to 150 and I added <?php if ( bp_has_members ( ‘per_page=150’ ) ) : ?> to the members.loop.php but without succes. What am I doing wrong? Do I have to change another template?

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

  • Jonas
    Participant

    @jonaskjodt


    dolf h
    Participant

    @dolf-h

    Thank you Jonas! I have put the code: <?php bp_has_members(bp_ajax_querystring(‘members’).’&per_page=150′))?> in index.php, members-loop.php and in bp-memberstemplate.php. Without success. Any more suggestions?


    Varun Dubey
    Participant

    @vapvarun

    @dolf-h You can use following codes for group directory and members directory

    add_filter( 'bp_after_has_groups_parse_args', 'wbcom_theme_alter_groups_parse_args' );
    function wbcom_theme_alter_groups_parse_args( $loop ) {
    	if ( bp_is_groups_directory() ) {
    	    {
    			$loop['per_page'] = 21;
    		}
    	}
    	return $loop;
    }

    For members directory replace 21 with your desired number

    add_filter( 'bp_after_has_members_parse_args', 'wbcom_theme_alter_members_parse_args' );
    function wbcom_theme_alter_members_parse_args( $loop ) {
    	if ( bp_is_members_directory() ) {
    		{
    		$loop['per_page'] = 21;
    		}
    	}
    	return $loop;
    }

    dolf h
    Participant

    @dolf-h

    Thank you, Vapvarun. I used the codes at the bottom of bp-groups-template.php and bp-members-template.php. Without success. Then I put in into my functions.php in my child-theme, no results.

    Perhaps I did something wrong?


    exnihilodesigns
    Participant

    @exnihilodesigns

    Has anyone been able to solve this issue with only 20 members showing per page? I’ve tried every bit of code and file change that I’ve found on the help forum and so far nothing has altered it. I’m using the Legacy theme if that helps.


    Anonymous User 18187419
    Inactive

    @anonymized-18187419

    hi exni,

    – tested code snippet above posted by vapvarun, for members directory.
    – works as expected on both legacy & nouveau

    details:
    WP 6.1.1
    BP 10.6.0
    Twenty sixteen theme.

    note: code snippet was added using Code Snippets plugin by Code Snippets Pro. (free)

    hope this helps you.


    exnihilodesigns
    Participant

    @exnihilodesigns

    I tried both versions in the functions.php file and with the Code Snippets plugin and it didn’t work. Does anyone know what might be overriding this? I’ve also changed the number to appear in the directory in the BuddyPress template files as well. Still only shows 20 members no matter what I try.

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