Added login/logut to the nav bar but it shows on both nav.
-
Hi im using this code:
function add_login_logout_link($items, $args) { if(is_user_logged_in()) { $newitems = $items; $newitems .= '<li><a title="Logout" href="'. wp_logout_url('index.php') .'">Logout</a></li>'; } else { $newitems = $items; $newitems .= '<li><a title="Login" href="'. wp_login_url('wp-admin/index.php') .'">Login</a></li>'; } return $newitems; } add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
It works but the problem is that it shows on both menus, how do I get to show it on a specific one?
thank you
/Ben
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Added login/logut to the nav bar but it shows on both nav.’ is closed to new replies.