BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › 'theme_location' of "BuddyPanel"?
Tagged: buddypanel, menu, menu item
- This topic has 2 replies, 2 contibutors, and was last updated 9 years, 1 months ago by Anonymous.
Viewing 3 posts - 1 through 3 (of 3 total)
Question
October 6, 2015 at 8:45 am #48045@snikayHi,
I’m trying to add a custom BP menu item to the left-panel (BuddyPanel).
The BP-item already exists and is working fine.To add this menu link to BuddyPanel I found this:
// Filter wp_nav_menu() to add collections link add_filter( 'wp_nav_menu_items', 'my_nav_menu_collections_link' ); function my_nav_menu_collections_link($menu) { if (!is_user_logged_in()) return $menu; else $profilelink = '<li><a class="fa fa-bookmark" href="' . bp_loggedin_user_domain( '/' ) . 'my-collections' . '">' . __('Collections') . '</a><div class="sub-menu-wrap"><a href="' . bp_loggedin_user_domain( '/' ) . 'my-collections' . '" class="fa-bookmark">' . __('Collections') . '</a></div></li>'; $menu = $menu . $profilelink; return $menu; }
But than the item also shows in another custom menu I made.
So I found out to point to a specific location;theme_location
probably.So I found this:
// Filter wp_nav_menu() to add profile link in a specific custom menu e.g. mamamia function mme_nav_menu_profile_link($menu, $args) { if( is_user_logged_in() && $args->theme_location == 'mamamia' ){ $profilelink = '<li><a href="' . bp_loggedin_user_domain( '/' ) . '">' . __('My Profile', 'yourtheme') . '</a></li>'; $menu = $menu . $profilelink; } return $menu; } add_filter( 'wp_nav_menu_items', 'mme_nav_menu_profile_link', 10, 2 );
But nothing is showing up by trying to replace
theme_location == 'mamamia'
with ‘BuddyPanel’ or ‘left-panel’.Answers
October 6, 2015 at 11:14 am #48058@snikayOh okay sorry, I got it.. It’s
left-panel-menu
October 6, 2015 at 11:45 am #48064@
Anonymous🙂
Viewing 3 posts - 1 through 3 (of 3 total)
- The question ‘'theme_location' of "BuddyPanel"?’ is closed to new replies.