Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Wasca

    (@wasca)

    ok I was able to get it to just display on my second menu by doing this

    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();
    		if( $args->theme_location == 'secondary-menu' ){
    			$items .= '<li>'. $loginoutlink .'</li>';
    		}
    		return $items;
    }

    Now how do I position it in the menu?

    I’d also like to know how. Tried changing the priority number 10 to something else, but it didn’t work.

    No extra coding is needed. Here is easy to use plugin – BAW Login/Logout menu:
    http://wordpress.org/extend/plugins/baw-login-logout-menu/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Login/Logout in Menu’ is closed to new replies.