How to Display a Link to the Group’s Forum in the BuddyPress Group Directory

Paste this function into your theme’s functions.php file and it will add a link to the group’s forum within the group directory. Here’s a screenshot:

1
2
3
4
5
6
7
8
9
10
11
12
function my_group_loop_forum_link() {

    if ( !bp_group_is_forum_enabled() )
        return;

    if ( !bp_group_is_visible() )
        return;

    echo '<a href="'. bp_get_group_forum_permalink() .'/">Forum →</a>';

}
add_action( 'bp_directory_groups_actions', 'my_group_loop_forum_link' );

*Note: This is for BuddyPress 1.2.3

Source: Rich Fuller at Etivite.com

Tags

Comments (2)

Participate