Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Can someone explain how to add tabs to the profile page?

have a look at the bp_core_new_subnav_item function

something like
`
bp_core_new_subnav_item( array( ‘name’ => ‘My Profile Page’ ), ‘slug’ => ‘my-profile-page’, ‘parent_url’ => $bp->loggedin_user->domain . $bp->profile->slug . ‘/’, ‘parent_slug’ => $bp->profile->slug, ‘screen_function’ => ‘my_profile_page_function_to_show_screen’, ‘position’ => 40 ) );
`

then the screen function to render the page:

`
function my_profile_page_function_to_show_screen() {

//add title and content here – last is to call the members plugin.php template
add_action( ‘bp_template_title’, ‘my_profile_page_function_to_show_screen_title’ );
add_action( ‘bp_template_content’, ‘my_profile_page_function_to_show_screen_content’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}
`

`
function my_profile_page_function_to_show_screen_title() {
echo ‘something’;
}
`
`
function my_profile_page_function_to_show_screen_content() {

//do something here for the page content

}
`

Skip to toolbar