Question about sparkling_header_menu();

I’m trying to find where sparkling_header_menu() is defined. I am currently building a site that requires a login. I don’t want to show a menu when a user is not logged in so i’d like to create an if statement defining which menu to use based on if the user is logged in or not(See example). I see where you registered the menu types in the functions.php but can’t seem to figure out where to go from there. Any help would be appreciated.

if( is_user_logged_in() ) {
     $menu = 'logged-in';
} else {
     $menu = 'logged-out';
wp_nav_menu( array( 'menu' => $menu, 'container_class' => 'menu-header', 'theme_location' => 'primary' ) );

Hi @chitcher1,

I hope you are well today and thank you for your question.

You can achieve it by using this Login Logout Register Menu – WordPress plugin | simple to use plugin.

Best Regards,

I downloaded this plugin and it does not do what i need it to do. It only adds a login link to the navigation and handles redirects(kind of). It doesn’t even default to a login screen when a user is not logged in. This doesn’t hide menu items nor does it swap menu’s based on log in status. Please help me to better understand my original question about the sparkling_header_menu() function so that i can add the code i need to.

Never mind i found it in the inc/extras.php file

That plugin does work fine for me.

Awesome great to see you got that found.

Please advise if you have more questions.

Have a fantastic day