Login Option

  • Author
    Posts
  • #39806

    Hello, I am trying to add a login option to my nirvana theme. I am doing it by adding code to functions.php file. Now when I ad the code to display my log in this is what I get.
    Pic of the log out option
    This is the code I use to display the log out option.
    function autov_add_loginout_navitem($items) {
    $login_item = ‘<li id=”login”>’.wp_loginout($_SERVER[‘REQUEST_URI’], false).’

    ‘;
    $items .= $login_item;
    return $items;
    }
    add_filter(‘wp_nav_menu_testmenu_items’, ‘autov_add_loginout_navitem’);

    Any ideas on how to remedy this issue, and thanks in advance for the responses.

    • This topic was modified 8 years ago by jdelgado96.
    • This topic was modified 7 years ago by Zed.
    • This topic was modified 7 years ago by Zed.
    #43350
    Zed
    Cryout Creations mastermind

    Which of the menus are you trying the extra link to?

    Are you sure you have the correct menu slug for the hook? Did you try using just the ‘wp_nav_menu_items’ filter?


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Login Option’ is closed to new replies.