Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding Sub Menu Items From Profile

  • Avatar of johnsorci
    johnsorci
    Participant

    @johnsorci

    I used the following code to add a “My Profile” navigation item on my website.

    // Filter wp_nav_menu() to add profile link
    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;
    }

    I put that in the theme.php

    I would like to be able to add sub-nav items under that. Is that possible?

You must be logged in to reply to this topic.