Skip to:
Content
Pages
Categories
Search
Top
Bottom

Direct Link To My Profile


  • foamymedia
    Participant

    @foamymedia

    can someone please supply me with the link i need in order to add a menu item so people can view their profile?

    looked high and low and can’t find it..

    surely it is a simple link??

    when they are logged in i want a menu item to say “my profile” and they can click it and get to the my profile page where they can edit there info etc

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)

  • Robkk
    Moderator

    @robkk

    // 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
            $current_user = wp_get_current_user();
            $user=$current_user->user_login ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/">My Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
     
    }

    i just edited the code listed here

    Layout and functionality – Examples you can use


    foamymedia
    Participant

    @foamymedia

    thanks that worked..

    however how would you get that to be a drop down menu item under “login” or “logout” as on

    http://ilovestaffordshire.co.uk

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar