Unique menu for one page and children pages.
-
I am currently using the below code to generate a secondary menu within the pages:
page_parent_1
page_child_1
page_child_2Is it possible to set it up so that it will create the menu in the parent ‘page_parent_1’ and automatically add to all the children without adding every child page id or slug to the <?php … ?> code.
<?php if ( is_page( array( 'page_parent_1', 'page_child_1', 'page_child_2' )) ) {echo wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'secondary' ) ) ;} ?>
I have tried using && $post->post_parent & get_page_children but have had no luck.
Any help is appreciated!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Unique menu for one page and children pages.’ is closed to new replies.