I have built a custom menu in Wordpress that contains links to posts and pages. I am adding it to my header using this line of code:
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'depth' => 0,
'menu_class' => 'nav-menu',
)
);
?>
My problem is, if I add a child page to the top level ones on the menu, they don't automatically appear as sublinks on the nav. I know I can create them manually each time by rebuilding the menu, but I would like to be able to just add a child page in the pages section and have it show up in the nav without having to go to the menu and build it there also, if that makes sense?
I've tried using depth => 0
, but that didn't work. Is there a way to have child pages show up without having to build it into the custom menu?