Skip to:
Content
Pages
Categories
Search
Top
Bottom

Showing + Filtering Groups


  • mikelast
    Participant

    @mikelast

    Hi all,
    On the front end on the groups page, I do not want to display any groups by default, I want the user to have to search for groups. How do I do that? I thought I passed in parameters like this
    if ( bp_has_groups( bp_ajax_querystring( 'groups' ) . '&per_page=0' ) ) but that doesn’t appear to have any effect what so ever. I am using the new bp-nouveau theme, looking at the groups-loop.php file

    thanks

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

  • Varun Dubey
    Participant

    @vapvarun

    @mikelast
    To change the number of groups display at group directory page, you can use the following snippet

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

    mikelast
    Participant

    @mikelast

    Nice try, but if you specify
    $loop['per_page'] = 0; it doesn’t work, the full list of groups is returned


    shanebp
    Moderator

    @shanebp

    Try $loop['include'] = '-1';


    Varun Dubey
    Participant

    @vapvarun

    even if that work with zero, the search result will also not visible


    mikelast
    Participant

    @mikelast

    @shanebp that still returns 1 result, and @vapvarun you can still see the entire results list being generated and returned

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