I want to be able to hide the 'My account' button when users are logged out and I want to be able to hide the 'Registration' button when users are logged in.
How would I go about doing this? I'm still a amatuer at WordPress and I'm still learning, this is what I have so far in my nav-menus.php file.
if( is_user_logged_in() ) {
wp_nav_menu( array( 'My Account' => 'logged-users' ) );
} else {
wp_nav_menu( array( 'Registration' => 'not-logged-users' ) );
}
I know this isn't correct, but I would love some help with it, please let me know if I'm missing any information.
wp_nav_menu()
function to exclude specific menu items.