Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'bp_nav_menu'

Viewing 21 results - 1 through 21 (of 21 total)
  • Author
    Search Results
  • #316907
    lynnapp
    Participant

    in 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 problem

    1. 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>
    lynnapp
    Participant

    I 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.10

    So 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 help

    #316925
    lynnapp
    Participant

    in 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 problem

    1. 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>
    #317296
    Simon Frntic
    Participant

    I 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?

    #311842
    IslamAboAsd
    Participant

    Hello
    I have issue when I try to add BuddyPress pages to WordPress menu it gets this issue

    Fatal error: Uncaught Error: Call to a member function get_primary() on null in /wp-content/plugins/buddypress/bp-core/bp-core-functions.php:2555 Stack trace:
     #0 /wp-content/plugins/buddypress/bp-core/bp-core-functions.php(2689): bp_nav_menu_get_loggedin_pages() 
     #1 /wp-content/plugins/buddypress/bp-core/bp-core-filters.php(744): 
        bp_nav_menu_get_item_url('activity')
     #2/wp-includes/class-wp-hook.php(287): bp_setup_nav_menu_item(Object(WP_Post))
     #3 /wp-includes/plugin.php(206): WP_Hook->apply_filters(Object(WP_Post), Array)
     #4 /wp-includes/nav-menu.php(984): apply_filters('wp_setup_nav_me...', Object(WP_Post)) 
     #5 [internal function]: wp_setup_nav_menu_item(Object(WP_Post)) 
     #6 /wp-includes/nav-menu.php(749): array_map('wp_setup_nav_me...', Array)
     #7 /wp-content/themes/ekommart/inc/megamenu/megamenu.php(34): wp_get_nav_menu_items in /wp-content/plugins/buddypress/bp-core/bp-core-functions.php on line 2555
    #309106
    kevinbrands
    Participant

    Hello,

    I’m loading a menu via Ajax. And the user specific items have the wrong URL’s.

    I’ve tried using bp_setup_nav_menu_item and bp_nav_menu_get_item_url without luck.

    I’m using wp_get_nav_menu_items to get items of a specific menu. After getting the items, I loop through them. When inspecting the object, it (still) has the wrong URL.

    How can I fix this?

    Thanks in advance!
    -Kevin

    #260850
    esavvides
    Participant

    WP version: 4.6.1
    BP version: 2.7.2

    Hi all. I’m surprised this solution isn’t easy to find as it seems like a lot of people would want to do this, but I guess most themes have it already. I’m trying to integrate BP into a theme that isn’t BP compatible. It works but isn’t styled for it.

    I moved the user navigation menu from the admin bar to the header so I could get rid of the admin bar altogether. Everything works except the Profile menu item isn’t showing the sub-menu. All the links are under Settings so I could just remove the Profile item. I just don’t know where the code is. I believe it’s pulling from ‘bp_nav_menu’ but I don’t know which file to tweak. Could you tell me where to look?

    Also, the main issue is the styling. I can’t seem to find the CSS code to modify the navigation menu. I’ve been messing with it but a few things I can’t seem to find.

    The code I used was from answer #2 on this link. (#1 didn’t seem to work as well.)

    http://stackoverflow.com/questions/31812132/buddypress-display-notification-and-profile-in-header-instead-of-wp-admin-bar

    The php code was fine but the CSS code was kind of a mess and needs a lot of padding and alignment adjustments. Mainly, could you tell me two things…

    1. Where do you add the alignment so the menu items are flush left?

    2. Which section is the styling for the individual menu items (Activity/Profile/etc.) in the dropdown? Thought I found it but the code doesn’t seem to be appearing.

    I know we’re supposed to post the link to our site but the menu only shows when you’re logged in and I’m still working on it so I prefer not to post it.

    Also, I’m not a programmer. I can use Firebug and tweak php code and CSS but I’m still learning a lot of the stuff you guys probably know really well. If I sound stupid, well, in a lot of things I am. 🙂

    Thanks for any help.

    #250487

    In reply to: Widget memberbox

    brx8r
    Participant

    Unfortunately 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.

    #242811
    romax100
    Participant

    Hello, I am trying to take BuddyPress nav menu with all the tabs like activity, profile, friends etc, and display it inside a widget on my right sidebar called theme my login.

    I found a php file of TML widget and inserted <?php bp_nav_menu(); ?> inside the code. It works like a charm, but only when I am in the mywebsite.com/members/%userid%/ directory. As soon as I click away to the homepage, or forums page, the menu loses a couple items and all of the links transform to http://activity/ format etc.

    I inspected the element with in browser tools. The menu that is being called when I navigate away from the profile page is the same one, and the only thing that randomly changes is the list of menu items and their links.
    Ii assume that bp-nav-menu is set to display only in the profile page. is that true, and how can I change it?

    Thanks

    #242487

    In reply to: Add dynamic menu link

    danbp
    Moderator

    Codex reference:

    Members Navigation Menus

    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' );
    CodeMonkeyBanana
    Participant

    Hi,

    I am having some trouble working out how look at bp method declarations. I want to do this so I can see if there are any helpful comments in code.

    For instance I want to use bp_nav_menu(). The documentation says there are various filters and you can use a navwalker but it doesnt say how to use it or what filters it uses so I need to look at code but when I search the buddypress folder for bp_nav_menu it returns no ocurrences.

    My IDE says all BP function don’t exist so I guess they are either inside a namespace or a class that is brought into scope at runtime. Is there anyway to call functions with fully qualified path or to know what the fully qualified path is?

    Any tips to navigate the code appreciated.

    #207698
    Henry Wright
    Moderator

    I’m using the bp_nav_menu_args filter hook to modify the args sent to bp_nav_menu(). The code assumes you’re using bp_nav_menu() to display your navigation menu. By changing the value of $args['echo'] to false, 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?

    #207687
    Henry Wright
    Moderator

    Hi @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.

    #175278
    Matt McFarland
    Participant

    Hi 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

    #171717
    Hugo Ashmore
    Keymaster

    Was 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();

    #168894
    Developer ICAN
    Participant

    Hi,

    Can you explain what you did?

    #168789
    mecanographik
    Participant

    Hi, 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,

    #165665
    Hugo Ashmore
    Keymaster

    You 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-menu

    #163805
    matrixd
    Participant

    Hi, is there anybody can help me with this?

    #163738
    matrixd
    Participant

    Hi everybody,

    I want to use loggined user profile navigation menu (with subnav) in my sidebar in every page across site (including buddypress and no-buddypress pages).

    I have tested the following:
    1. bp_nav_menu(): Displays the navigation with the new html way and the subnav, but when I’m in another user profile it displays the navigation menu of that user and not the loggedin user.

    2. bp_get_loggedin_user_nav(): Displays the navigation without subnav.

    How can I use loggined user profile navigation menu with subnav in my sidebar in every page across site.

    Thanks
    Kostas

    @mercime
    Keymaster

    `’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/

    Goodbye, headaches. Hello, menus!

Viewing 21 results - 1 through 21 (of 21 total)
Skip to toolbar