I will show you easier tutorial add WP login Link to Your Navigation Menu Automatically. We only needed to some function to our functions.php and WP Login link will be automatically added into our WordPress Navigation Menu.
Description About wp_loginout()
Displays a login link, or if a user is logged in, displays a logout link. An optional, redirect argument can be used to redirect the user upon login or logout.
First, open your functions.php and add this code
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
function add_login_logout_link($items, $args) {
ob_start();
wp_loginout('index.php');
$loginoutlink = ob_get_contents();
ob_end_clean();
$items .= '<li>'. $loginoutlink .'</li>';
return $items;
}
That’s it, now you menu navigation will be added wp_loginout() automatically. More details about what going on this code you can read it here
Function Reference:




Pingback: Tweets that mention How To Add WP Login Link to Your Navigation Menu Automatically # WordPress Tricks & Tips -- Topsy.com
Pingback: How to Add a Search Form on Navigation Menu Automatically | WordPress News Wire