Skip to:
Content
Pages
Categories
Search
Top
Bottom

Linking to profile menu items to main navigation


  • arctius
    Participant

    @arctius

    Hi,

    I am trying to link Buddypress to the main navigator. I want it only to show if the user is logged in.

    This code does almost what i want. but i cant figure how i can get i to work with buddydrive

    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) {
    	if (!is_user_logged_in())
    		return $menu;
    	else
    		$profilelink = '<li><a href="' . bp_loggedin_user_domain( '/' ) . '">' . __('My Profile') . '</a></li>';
    		$menu = $menu . $profilelink;
    		return $menu;
    }

    Source: https://buddypress.org/support/topic/url-for-menu-to-logged-in-users-profile-page/

  • The topic ‘Linking to profile menu items to main navigation’ is closed to new replies.
Skip to toolbar