Only display nav menu if it is populated with menu items?
This solution was shared by @TheDeadMedic over here… $menu_exists_and_has_items = wp_nav_menu( array( ‘theme_location’ => ‘example-menu-location’, ‘container_class’ => ‘example-menu-container’, ‘menu_class’ => ‘example-menu-class’, ‘fallback_cb’ => false, ‘echo’ => false ) ); if ( $menu_exists_and_has_items ) { … Importantly, note that the menu is not echoed in the initial array saved to PHP variable…