Skip to:
Content
Pages
Categories
Search
Top
Bottom

List All Groups

  • @gardendarts

    Participant

    Here’s my code creating a shortcode to list all groups. But it’s not a loop, it only lists the first group created.

    function list_groups_shortcode($group) {
    
        return "<div><h2 align='center'>Groups</h2><button type='button' class='groupButton'><a href='" . bp_get_group_permalink( $group ) . "'>" . bp_get_group_name( $group ) . "</a></div>";
    }
    add_shortcode('groups', 'list_groups_shortcode');

    Any help much appreciated.

  • You must be logged in to reply to this topic.
Skip to toolbar