Buddypress : get the group pagination working outside the original template pages

Hi guys

I have a problem with Buddypress, pagination and groups :

I added the plugin goup tag to add a specific tag for groups and I need to display a group list with a specific tag on a custom page and keep the pagination working.

I pimped up a page which can do that getting the function of the group tag plugin and it works.
However, the pagination is not working.

<?php function gtags_show_groups_for_tag1( $groups ) {
		global $bp, $groups_template, $gtags_done;

			$tag = 'espionnage';

			if ( $tag ) {
				$gtags_groups = gtags_get_groups_by_tag( null, null, false, false, $tag );
				$groups_template->groups = $gtags_groups[groups];
				// turn off pagination
				$groups_template->group_count = $gtags_groups[total];
				$groups_template->total_group_count = $gtags_groups[total];
				$groups_template->pag_num = $gtags_groups[total];
				$groups_template->pag_page = 1;
				$groups_template->pag_links = '';
				$groups = $gtags_groups;
			}

			$gtags_done = true; // only run it once, so that the widgets function shows normal groups, not tags.
			return $groups;
		}
		add_filter( 'bp_has_groups', 'gtags_show_groups_for_tag1', 5, 2 );
		if ( bp_has_groups() ) : ?>

then i put the original group loop + close everything and original buddypress pagination function.

I noticed that there is a " // turn off pagination" but I cant figure out where it is turned off.

Thanks for your help / advice

  • aecnu

    Greetings quentinn,

    Thank you for being a WPMU Dev member!

    After reading over your post I am confused on what action to take that may help in the obvious custom development that you have got going on here.

    Let me know if we can be of assistance giving me some direction as to what angle you are specifically working on the do what you want to do.

    Thanks again for being a WPMU Dev member.

    Cheers, Joe :slight_smile:

    If this thread is not resolved because the suggested action did not work or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

  • quentinn

    Thanks for answering.
    I want to display a list of groups on a custom page created with wordpress, let's call it "my tribes". I copied the original loop in index.php and groups-loop.php (in the groups subdirectory). The groups are displaying right with the pagination BUT the problem is that the paginatio is not working.
    Once I click on the 2nd page, I have message returnng "no group"

    I noticed that the link to go to the 2 page is
    my-tribes/?grpage=1&num=3

    whereas on the original group page it is :

    groups?grpage=1&num=3

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.