Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter groupsby slug?

  • Profile photo of jonzlin95
    jonzlin95
    Participant

    @jonzlin95

    Buddypress Version: 1.8.1
    Wordpress Version: 3.6
    Site: http://roptest.theradlab.org/groups/

    Hi,

    I’m trying to build a buddypress with 3 different categories of groups. However, I can’t seem to figure out how to filter groups. I am trying to create 3 different pages that would show all groups of a certain category.

    So far I have installed http://wordpress.org/plugins/bp-group-hierarchy/ to create a group hierarchy, but I’m not sure how I can filter groups in a certain way.

    I’ve looked up the bp_has_groups() function, but it seems too limited for my purpose.

    Groups Loop

    Thanks in advance!
    -Jon

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Jon-

    You’ve probably already solved this, but I’m thinking you’re going to need top attach some meta to the groups, then use the very cool new group meta filter for bp_has_groups(). The group loop might look like:

    $args = array( 
    		'meta_query' => array(
    			array(
    				'key' => 'meta_key',
    				'value' => 'value_1',
    				'compare' => 'LIKE',
    			)
    		) 
    	);
    
    	if ( bp_has_groups ( $args ) ) { //...

    Here’s an example of writing a plugin to collect group meta: https://codex.buddypress.org/plugindev/how-to-edit-group-meta-tutorial/

    Good luck!

    Profile photo of jonzlin95
    jonzlin95
    Participant

    @jonzlin95

    Hey Dcavins,

    Thanks for the reply. I found that and implemented the functionality, but now on my groups directory pages, the Search and Order By functionality are broken. Do you know how we can fix this?

    Thanks in advance
    -Jon

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter groupsby slug?’ is closed to new replies.
Skip to toolbar