I’ve got a customer requirement that says display a different menu if a user is logged in.
In some themes, there’s a navigation snippet that can be copied into the child theme.
if (is_home()) {
wp_nav_menu( array(
'theme_location' => 'header-menu',
'menu' => 'blog-menu',
'container' => false,
'fallback_cb' => '',
'menu_class' => 'primary-menu bb-primary-overflow', )
);
} else {
wp_nav_menu( array(
'theme_location' => 'header-menu',
'menu_id' => 'primary-menu',
'container' => false,
'fallback_cb' => '',
'menu_class' => 'primary-menu bb-primary-overflow', )
);
}
In GP, this is all in the navigation.php, which is ~400 lines of code and I don’t think I really want it in my child theme.
Is there a GP-friendly way to accomplish this?
Hacky ideas include generating all possible menu sites, and then using conditional javascript to hide them.