Tagged: login button
Hello,
I’m looking for the submenu location theme position.
E.g: Main Menu is: primary and footer is footer-menu, what is the submenu? I’ve tried ‘submenu’ and ‘sub-menu’
I need it for the following code where as I’m adding a login/logout button in the top menu.
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 == 'sub-menu' ) {
$items .= '<li>'. $loginoutlink .'</li>';
}
return $items;
}
So I would replace ‘sub-menu’ with whatever the top theme location is.. if you could let me know that would be great! I’ve searched the code and can’t seem to find it.
Cheers,
Daniel
Solved it!
If anyone else needs the above you can use it for either ‘primary’ which is your main menu or ‘avia2’ which is your very top menu. :)
Peace,
Daniel