Buddypress – Groups navigation / redirect to forum (this again)

If you’ve customized a BP site before, you’ll know that the groups nav bp_get_options_nav(); can be a real barrier in getting a site exactly the way you want it.

There was an older solution to involving a permanent redirect (not ideal for SEM purposes) from home/ to forum/….

Read More

`

function redirect_to_forum() {
        global $bp;

        $path = clean_url( $_SERVER['REQUEST_URI'] );

        $path = apply_filters( 'bp_uri', $path );

        if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false )
                bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
}
add_action( 'wp', 'redirect_to_forum' );

`

and this one works in BP 1.5

`

function redirect_to_forum() {
    global $bp;

    $path = clean_url( $_SERVER['REQUEST_URI'] );

    $path = apply_filters( 'bp_uri', $path );

    if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false )
                bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . 'forum/' );
}
add_action( 'bp_init', 'redirect_to_forum' );

`

Is there no other way of moving functionality around in Buddypress Groups without creating explosions? It would be really nice just to be able to change the include file references in /groups/single/home.php to pull the functionality you wanted. For example…

`

elseif ( bp_group_is_visible() ) :
locate_template( array( 'groups/single/** change this to any file within /single/ **' ), true );

`

If you change the home.php include file reference to forumn’s, the forum’s display just fine, however the add new topic functions and support do not seem to be dialed in… create a new topic and nothing happens… so in order to tap into forum functionality you actually need to be at the “forum” slug i.e. /forum/… is there any way of getting around this?

To summarize… I’m trying to get the forum’s functionality working at the group root i.e. “sitename.com/groups/group-name/” WITHOUT a redirect to “sitename.com/groups/group-name/forumn/”

Any thoughts? suggestions? similar experiences?

Related posts

Leave a Reply