Hi Kyle,
I guess i copied this into my functions php. First trying after searching the knowledge base and then ask in a new topic ๐
No login / Logout on the mobile menu
/* ========================================
Login logout in menu mobile
===========================================*/
add_filter( ‘wp_nav_menu_items’, ‘sf_loginout_menu_link’, 10, 2 );
function sf_loginout_menu_link( $items, $args ) {
if ($args->theme_location == ‘main_navigation’) {
if (is_user_logged_in()) {
$items .= ‘<li class=”custom_mobile”>Log Out‘;
} else {
$items .= ‘<li class=”custom_mobile”>Log In‘;
}
}
return $items;
}
?>
<?php
However. Can this be done only for the mobile menu and not for the normal site? So that it still exists in the mobile version but is is normal in the pc environment?
Cheers,
Maarten