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 4 replies - 1 through 4 (of 4 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?

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