Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Making the “Profile” Tab Open When Viewing a Profile vs “Activity”


pcwriter
Participant

@pcwriter

@thealchemist @zkwc @djpaul

Hurray!

The code snippet works just fine in functions.php. That’s good news for a theme designer: no worries about a theme overriding a user’s custom configurations in bp-custom.php.
Now I’m off to add “Group Landing Page” as an option in my new theme. It’ll be incorporated with the theme’s “Alternate Header” option too.

Then I’ve got to adapt the code to work with member profiles. My initial attempts have failed, but I’ve been known to be persistent at times ;-)

For future reference, here’s the code snippet to add to functions.php or, if you have created it, bp-custom.php.
You can see it in action here: http://rspacesandbox.org/ Click any group.

`function redirect_groups_to_forum() {
global $bp;
$path = clean_url( $_SERVER );
$path = apply_filters( ‘bp_uri’, $path );
if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav ) === false )
bp_core_redirect( $path . $bp->bp_options_nav . ‘/’ );
}
add_action( ‘wp’, ‘redirect_groups_to_forum’ );`

Skip to toolbar