BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Profile menu
Tagged: menu
- This topic has 4 replies, 3 contibutors, and was last updated 8 years, 10 months ago by Anonymous.
Question
January 15, 2016 at 9:34 am #56348@infomushugas I can add one more to the menu option, but in the first place the menu before “activity” .. I want to add an option “home” this will be a page with pictures
Answers
January 16, 2016 at 7:42 am #56391@
AnonymousHi @infomushug, Please add this function inside your child theme’s function.php
change the slug with your page slug you want to display as ‘home’.
function my_setup_nav() { global $bp; bp_core_new_nav_item( array( 'name' => __( 'Home', 'buddypress' ), 'slug' => 'home', 'position' => 1, 'screen_function' => 'my_item_one_template', ) ); } add_action( 'bp_setup_nav', 'my_setup_nav' );
Regards
January 16, 2016 at 9:02 am #56395@infomushugthanks Pallavi not understand this part
my page is called “Home”
I have it on the menubp_core_new_nav_item( array(
‘name’ => __( ‘Home’, ‘buddypress’ ), —-()
‘slug’ => ‘home’, —–(who settled here??)
‘position’ => 1,
‘screen_function’ => ‘my_item_one_template’, —–(who settled here??)
) );January 16, 2016 at 9:56 am #56402@infomushug@pallavi
and this “Home” first
IMG — 14,, but clicking an error 404
what I need is that the page “home” is active at the beginning
page “HOME” .—IMG 13
help me, thanks
January 16, 2016 at 1:19 pm #56429@
AnonymousHi @infomushug, These are BuddyPress specific queries
you can also consul them inside BuddyPress forum https://buddypress.org/support/
You will need to create proper screen function code which depends upon what functionality you need there.A sample code
function add_animal_tabs() { global $bp; bp_core_new_nav_item( array( 'name' => 'Animals', 'slug' => 'animals', 'parent_url' => $bp->displayed_user->domain, 'parent_slug' => $bp->profile->slug, 'screen_function' => 'animals_screen', 'position' => 200, 'default_subnav_slug' => 'animals' ) ); bp_core_new_subnav_item( array( 'name' => 'Dogs', 'slug' => 'dogs', 'parent_url' => trailingslashit( bp_displayed_user_domain() . 'animals' ), 'parent_slug' => 'animals', 'screen_function' => 'dogs_screen', 'position' => 100, 'user_has_access' => bp_is_my_profile() ) ); bp_core_new_subnav_item( array( 'name' => 'Cats', 'slug' => 'cats', 'parent_url' => trailingslashit( bp_displayed_user_domain() . 'animals' ), 'parent_slug' => 'animals', 'screen_function' => 'cats_screen', 'position' => 150, 'user_has_access' => bp_is_my_profile() ) ); } add_action( 'bp_setup_nav', 'add_animal_tabs', 100 ); function animals_screen() { add_action( 'bp_template_content', 'animals_screen_content' ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); } function animals_screen_content() { echo 'Animals<br/>'; } function dogs_screen() { add_action( 'bp_template_content', 'dogs_screen_content' ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); } function dogs_screen_content() { echo 'Dogs'; } function cats_screen() { add_action( 'bp_template_content', 'cats_screen_content' ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); } function cats_screen_content() { echo 'Cats'; }
Regards
Varun Dubey
- The question ‘Profile menu’ is closed to new replies.