Hey
I am using the following snippet to have login/0ut and register links in my main menu.
///////////// LOGIN AND REGO /////////////////////////////////
// LOGINOUT AND REGO LINK IN MAIN MENU
function add_login_logout_register_menu( $items, $args ) {
if ( $args->theme_location != 'primary' ) {
return $items;
}
if ( is_user_logged_in() ) {
$items .= '<li><a href="' . wp_logout_url() . '">' . __( 'Log Out' ) . '</a></li>';
} else {
$items .= '<li><a href="' . wp_login_url() . '">' . __( 'Login In' ) . '</a></li>';
$items .= '<li><a href="' . wp_registration_url() . '">' . __( 'Register' ) . '</a></li>';
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'add_login_logout_register_menu', 199, 2 );
// END LOGINOUT IN MENU
I have too many tab on my navigation and so I would like to put the login/out and Register links as submenu items under a single nav tab called Members.
What tweaks to the above snippet are required to achieve this.
Thanks in advance for your help.