Need login/logout on menu
-
Hi, I’ve been so pleased with your menu plugin and am so glad I got the developen License. Came across my first issue today.
I frequently use the code below to add a login to the menu which is smart enough to change to logout when signed in. This puts the link on the WordPress menu but it doesn’t seem to work with your plugin. I’m hoping it’s an easy fix for you to add that.
Thanks!
Jimadd_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 .= ‘- ‘. $loginoutlink .’
‘;
return $items;
}From this webpage:
https://premium.wpmudev.org/blog/how-to-add-a-loginlogout-link-to-your-wordpress-menu/
The page I need help with: [log in to see the link]
- The topic ‘Need login/logout on menu’ is closed to new replies.