Search Results for 'bp_nav_menu'
-
AuthorSearch Results
-
May 21, 2021 at 9:27 am #316907
Topic: menu with bp_nav_menu()
in forum How-to & Troubleshootinglynnapp
Participantin my child theme I have added this to the members/single/parts/item-nav
<label class="toggle" for="toggle">☰ <span>Menu</span></label> <input class="toggle" id="toggle" type="checkbox"> <nav class="<?php bp_nouveau_single_item_nav_classes(); ?>" id="object-nav" role="navigation" aria-label="<?php esc_attr_e( 'Member menu', 'buddypress' ); ?>"> <?php if ( bp_nouveau_has_nav( array( 'type' => 'primary' ) ) ) : ?> <ul> <?php bp_nav_menu(); ?> </ul> <?php endif; ?> </nav>I have removed the submenu form all the other page fronts
So this is the problem1. The loop for the sub-menus is
a. Putting the profile menu items under a new submenu under settings
(this submenu )<ul class="sub-menu"> <li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">View</a></li> <li id="edit-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/edit/#item-header-content">Edit</a></li> <li id="change-avatar-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-avatar/#item-header-content">Change Profile Photo</a></li> <li id="change-cover-image-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-cover-image/#item-header-content">Change Cover Image</a></li> </ul>Here is the source codes for the menus while looking at looking at my own profile not as admin.
So I was wondering if the walker argument could help with this, but I could not find any documentation on that part.
Could you point me to where or how to get the profile submenu items under the profile li and not as a sub sub of settings?<nav class="main-navs no-ajax bp-navs single-screen-navs user-nav-tabs tabbed-links horizontal users-nav" id="object-nav" role="navigation" aria-label="Member menu"> <ul> <div class="menu-bp-container"><ul id="menu-bp" class="menu"><li id="front-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/front/#item-header-content">Home</a> <ul class="sub-menu"> <li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/front/#item-header-content">View</a></li> </ul> </li> <li id="xprofile-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">Profile</a></li> <li id="activity-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/activity/#item-header-content">Activity</a> <ul class="sub-menu"> <li id="just-me-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/#item-header-content">Personal</a></li> <li id="activity-mentions-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/mentions/#item-header-content">Mentions</a></li> <li id="activity-favs-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/favorites/#item-header-content">Favorites</a></li> <li id="activity-friends-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/friends/#item-header-content">Friends</a></li> <li id="activity-groups-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/groups/#item-header-content">Groups</a></li> </ul> </li> <li id="friends-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/friends/#item-header-content">Friends <span class="count" style="cursor: pointer;">1</span></a> <ul class="sub-menu"> <li id="friends-my-friends-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/friends/#item-header-content">Friendships</a></li> <li id="requests-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/friends/requests/#item-header-content">Requests</a></li> </ul> </li> <li id="notifications-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/#item-header-content">Notifications <span class="count" style="cursor: pointer;">1</span></a> <ul class="sub-menu"> <li id="notifications-my-notifications-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/#item-header-content">Unread</a></li> <li id="read-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/read/#item-header-content">Read</a></li> </ul> </li> <li id="invite-anyone-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/#item-header-content">Send Invites</a> <ul class="sub-menu"> <li id="invite-new-members-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/#item-header-content">Invite New Members</a></li> <li id="sent-invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/sent-invites/#item-header-content">Sent Invites</a></li> </ul> </li> <li id="settings-personal-li" class="menu-parent current-menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">Settings</a> <ul class="sub-menu"> <li id="general-personal-li" class="menu-child current-menu-item"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">General</a></li> <li id="notifications-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/notifications/#item-header-content">Email</a></li> <li id="profile-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/profile/#item-header-content">Profile Visibility</a> <ul class="sub-menu"> <li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">View</a></li> <li id="edit-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/edit/#item-header-content">Edit</a></li> <li id="change-avatar-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-avatar/#item-header-content">Change Profile Photo</a></li> <li id="change-cover-image-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-cover-image/#item-header-content">Change Cover Image</a></li> </ul> </li> <li id="invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/invites/#item-header-content">Group Invites</a></li> <li id="data-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/data/#item-header-content">Export Data</a></li> <li id="delete-account-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/delete-account/#item-header-content">Delete Account</a></li> </ul> </li> <li id="groups-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/groups/#item-header-content">Groups <span class="no-count">0</span></a> <ul class="sub-menu"> <li id="groups-my-groups-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/groups/#item-header-content">Memberships</a></li> <li id="invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/groups/invites/#item-header-content">Invitations</a></li> </ul> </li> </ul></div> </ul> </nav>May 21, 2021 at 9:24 am #316926Topic: menu function bp_nav_menu order of items ?
in forum How-to & Troubleshootinglynnapp
ParticipantI added the code bp_nav_menu() to the single/parts/item-nav in my child theme and all is working well except the profile buttons are going under settings
I have removed the submenu form all the other page fronts
I am on WP 5.6, BP 7.10So this is the problem
1. The loop for the sub-menus is
a. Putting the profile menu items under a the settings=>profile tab 1, making a third drop down from profile-personal-li and I think it should be under profile not settings.Here is the source codes for the menus while looking at looking at my own profile not as admin.
So I was wondering if the walker argument could help with this, but I could not find any documentation on that part.
Could you point me to where or how to get the profile submenu items under the profile li and not as a sub sub of settings? It worked okay with the tabbed default menus of the nouveau theme.<li id="settings-personal-li" class="menu-parent current-menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">Settings</a> <ul class="sub-menu"> <li id="general-personal-li" class="menu-child current-menu-item"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">General</a></li> <li id="notifications-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/notifications/#item-header-content">Email</a></li> <li id="profile-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/profile/#item-header-content">Profile Visibility</a> <ul class="sub-menu"> <li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">View</a></li> <li id="edit-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/edit/#item-header-content">Edit</a></li> <li id="change-avatar-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-avatar/#item-header-content">Change Profile Photo</a></li> <li id="change-cover-image-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-cover-image/#item-header-content">Change Cover Image</a></li> </ul> </li> <li id="invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/invites/#item-header-content">Group Invites</a></li> <li id="data-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/data/#item-header-content">Export Data</a></li> <li id="delete-account-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/delete-account/#item-header-content">Delete Account</a></li> </ul> </li>Also if you look at someone else’s profile it, the menu leaves out the ones I don’t have access too so there is the profile button then a view buttons at the end which is really for view profile.
Thank you for any helpMay 21, 2021 at 9:24 am #316925Topic: bp_nav_menu() order of items ?
in forum How-to & Troubleshootinglynnapp
Participantin my child theme I have added this to the members/single/parts/item-nav
<label class=”toggle” for=”toggle”>☰ <span>Menu</span></label>
<input class=”toggle” id=”toggle” type=”checkbox”><nav class=”<?php bp_nouveau_single_item_nav_classes(); ?>” id=”object-nav” role=”navigation” aria-label=”<?php esc_attr_e( ‘Member menu’, ‘buddypress’ ); ?>”>
<?php if ( bp_nouveau_has_nav( array( ‘type’ => ‘primary’ ) ) ) : ?>-
<?php bp_nav_menu(); ?>
<?php endif; ?>
</nav>I have removed the submenu form all the other page fronts
So this is the problem1. The loop for the sub-menus is
a. Putting the profile menu items under a new submenu under settings
(this submenu )<ul class="sub-menu"> <li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">View</a></li> <li id="edit-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/edit/#item-header-content">Edit</a></li> <li id="change-avatar-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-avatar/#item-header-content">Change Profile Photo</a></li> <li id="change-cover-image-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-cover-image/#item-header-content">Change Cover Image</a></li> </ul>Here is the source codes for the menus while looking at looking at my own profile not as admin.
So I was wondering if the walker argument could help with this, but I could not find any documentation on that part.
Could you point me to where or how to get the profile submenu items under the profile li and not as a sub sub of settings?<nav class="main-navs no-ajax bp-navs single-screen-navs user-nav-tabs tabbed-links horizontal users-nav" id="object-nav" role="navigation" aria-label="Member menu"> <ul> <div class="menu-bp-container"><ul id="menu-bp" class="menu"><li id="front-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/front/#item-header-content">Home</a> <ul class="sub-menu"> <li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/front/#item-header-content">View</a></li> </ul> </li> <li id="xprofile-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">Profile</a></li> <li id="activity-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/activity/#item-header-content">Activity</a> <ul class="sub-menu"> <li id="just-me-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/#item-header-content">Personal</a></li> <li id="activity-mentions-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/mentions/#item-header-content">Mentions</a></li> <li id="activity-favs-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/favorites/#item-header-content">Favorites</a></li> <li id="activity-friends-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/friends/#item-header-content">Friends</a></li> <li id="activity-groups-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/groups/#item-header-content">Groups</a></li> </ul> </li> <li id="friends-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/friends/#item-header-content">Friends <span class="count" style="cursor: pointer;">1</span></a> <ul class="sub-menu"> <li id="friends-my-friends-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/friends/#item-header-content">Friendships</a></li> <li id="requests-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/friends/requests/#item-header-content">Requests</a></li> </ul> </li> <li id="notifications-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/#item-header-content">Notifications <span class="count" style="cursor: pointer;">1</span></a> <ul class="sub-menu"> <li id="notifications-my-notifications-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/#item-header-content">Unread</a></li> <li id="read-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/read/#item-header-content">Read</a></li> </ul> </li> <li id="invite-anyone-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/#item-header-content">Send Invites</a> <ul class="sub-menu"> <li id="invite-new-members-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/#item-header-content">Invite New Members</a></li> <li id="sent-invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/sent-invites/#item-header-content">Sent Invites</a></li> </ul> </li> <li id="settings-personal-li" class="menu-parent current-menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">Settings</a> <ul class="sub-menu"> <li id="general-personal-li" class="menu-child current-menu-item"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">General</a></li> <li id="notifications-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/notifications/#item-header-content">Email</a></li> <li id="profile-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/profile/#item-header-content">Profile Visibility</a> <ul class="sub-menu"> <li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">View</a></li> <li id="edit-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/edit/#item-header-content">Edit</a></li> <li id="change-avatar-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-avatar/#item-header-content">Change Profile Photo</a></li> <li id="change-cover-image-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-cover-image/#item-header-content">Change Cover Image</a></li> </ul> </li> <li id="invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/invites/#item-header-content">Group Invites</a></li> <li id="data-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/data/#item-header-content">Export Data</a></li> <li id="delete-account-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/delete-account/#item-header-content">Delete Account</a></li> </ul> </li> <li id="groups-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/groups/#item-header-content">Groups <span class="no-count">0</span></a> <ul class="sub-menu"> <li id="groups-my-groups-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/groups/#item-header-content">Memberships</a></li> <li id="invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/groups/invites/#item-header-content">Invitations</a></li> </ul> </li> </ul></div> </ul> </nav>February 19, 2021 at 8:14 am #317296Topic: User profile ID same as user ID
in forum How-to & TroubleshootingSimon Frntic
ParticipantI use function bp_nav_menu($defaults); for creating custom logged user profile menu, which I show on every webpage in website. It works ok on all pages except on viewing some memeber usr profile page.
On member profile page my custom menu shows links to profile of member I currently view on page.I looked into function parameters but there isn’t option to insert user id. So how can I force bp_nav_menu to use logged user for creating menu, or how do I fix this?
March 3, 2016 at 12:11 am #250487In reply to: Widget memberbox
brx8r
ParticipantUnfortunately it seems the HTML returned by bp_nav_menu() does not contain the same options and links as the similar menu that appears in the admin bar. For example, there is no ability to create a group from that menu.
July 28, 2015 at 8:50 am #242487In reply to: Add dynamic menu link
danbp
ParticipantCodex reference:
Also, on the forum, several topics, with many snippets:
https://buddypress.org/support/search/bp_nav_menu/Here a working example, which add 2 external links on a profile.
function bpfr_custom_setup_nav() { if ( bp_is_active( 'xprofile' ) ) ?> <li><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members', 'buddypress' ) ); ?></a></li> <li><a href="http://buddypress.org" target="_blank" title="BP">BuddyPress</a></li> <?php } add_action( 'bp_member_options_nav', 'bpfr_custom_setup_nav' );October 9, 2014 at 1:32 pm #207698In reply to: Hiding the BuddyPress menu on specific BP pages
Henry Wright
ModeratorI’m using the
bp_nav_menu_argsfilter hook to modify the args sent tobp_nav_menu(). The code assumes you’re usingbp_nav_menu()to display your navigation menu. By changing the value of$args['echo']tofalse, a string containing the nav menu markup is returned (i.e. not echo’d to screen).The 2nd line is just a conditional to govern which pages the filter function applies to.
I didn’t get the chance to test it myself. Can you provide more info on how it isn’t working?
October 9, 2014 at 10:59 am #207687In reply to: Hiding the BuddyPress menu on specific BP pages
Henry Wright
ModeratorHi @tomatillo
It’s definitely possible. Actually, there’s probably many ways to do it.
Try adding this to your theme’s functions.php file:
function my_custom_bp_nav_menu( $args ) { if ( bp_is_current_action( 'following' ) || bp_is_current_action( 'followers' ) ) $args['echo'] = false; return $args; } add_filter( 'bp_nav_menu_args', 'my_custom_bp_nav_menu' );Note: I haven’t tested.
December 8, 2013 at 4:33 pm #175278In reply to: Create html image link to logged in user's profile
Matt McFarland
ParticipantHi there,
IF you’re familiar with wp_nav_menu() (see wp codex) bp_nav_menu() behaves the same way, and that’s the easiest way, I”ve found, to customize it. I hope this helps
September 23, 2013 at 4:39 pm #171717In reply to: List all subnav items within members main nav
Hugo Ashmore
ParticipantWas rolled out a while back in 1.7 but isn’t yet in use in any BP theme, currently being implemented on the ‘TemplatePack’ project.
bp_nav_menu();
July 27, 2013 at 7:00 am #168894In reply to: Navigation with bp_nav_menu()
Developer ICAN
ParticipantHi,
Can you explain what you did?
July 25, 2013 at 12:50 pm #168789In reply to: Navigation with bp_nav_menu()
Pierre from DesignBots
ParticipantHi, You can check what we’ve done for the French Buddypress community with @imath here :
Check my profile for example :
http://bp-fr.net/membres/mecanographik/regards,
June 9, 2013 at 3:07 pm #165665In reply to: Adding submenu to nav menus
Hugo Ashmore
ParticipantYou currently can’t really do this, but you could look at re-factoring the markup to use the newish (added in 1.7) bp_nav_menu() which provides a true nested ul construct and in a similar fashion that WP handles menus.
You can see an example test case I ran up using the function and re-factoring templates:
https://github.com/hnla/hnla-bp-nav-menuMay 12, 2013 at 8:52 am #163805In reply to: Navigation with bp_nav_menu()
matrixd
ParticipantHi, is there anybody can help me with this?
November 15, 2011 at 12:18 am #124408@mercime
Participant`’menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ‘bp_dtheme_main_nav’ ` pertains to the adoption of the wp_nav_menu function which allows users to create their own menu. This falls back to wp_page_menu and bp_nav_menu.
https://codex.buddypress.org/extending-buddypress/how-to-set-up-your-main-site-navigation-using-the-built-in-wordpress-menus/ -
AuthorSearch Results