bp_core_remove_nav_item
-
Hi everyone, using this function (in the subject line) doesn’t just remove the item from the navigation menu, it removes it from the entire functionality of BuddyPress as this previous poster found:
https://buddypress.org/support/topic/removing-nav-item-prevents-access-to-corresponding-page/
Holy moly! I just wanted to redesign the layout of the links! Is there a way to *just* remove the navigation item without removing the functionality? I still want to use messages…just want to reposition it on the page!
Thanks
Sheri
-
Like the other poster, I have used css to hide the items for now. Hopefully that is not the only thing I can do because the items I want to remove from the list are only available for paid members. Changing the css is too simple to make this secure.
Hi @muskokee,
BP nav menu code is in bp-core-template.php:3050 to EOF.To change the position of an item on profiles page, use this from within bp-custom.php
Position is defined by the numeric value:function bpfr_profile_menu_tab_pos(){ global $bp; $bp->bp_nav['activity']['position'] = 30; $bp->bp_nav['forums']['position'] = 50; $bp->bp_nav['profile']['position'] = 25; $bp->bp_nav['messages']['position'] = 10; $bp->bp_nav['notifications']['position'] = 40; $bp->bp_nav['friends']['position'] = 20; $bp->bp_nav['groups']['position'] = 60; } add_action('bp_setup_nav', 'bpfr_profile_menu_tab_pos', 100);
You can also add some condition on the template. Ie
if ( is_user_logged_in() ) : your custom menu stuff else something for non logged user endif;
Other reference: https://codex.buddypress.org/themes/members-navigation-menus/
Thanks @danbp!
- The topic ‘bp_core_remove_nav_item’ is closed to new replies.