List subpages in WordPress navigation menu
-
Hi,
I’ve read https://codex.www.ads-software.com/Function_Reference/wp_nav_menu and https://codex.www.ads-software.com/Template_Tags/wp_list_pages
I’d like to list subpages in the navigation menu in header.php for the Photos page. My current navigation menu code at denisejacksonmusic.com is
<?php wp_list_pages('title_li=&depth=1&sort_column=menu_order&exclude=69,75,84'); ?>
I’ve tried adding the following code to header.php to list subpages for the top navigation menu at denisejacksonmusic.com but it’s not working properly. I want to exclude the 3 pages listed in the above code.
<?php $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0'); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?>
Could someone help me find the correct code so that I exclude exclude=69,75,84 from the navigation menu top pages and subpages?
- The topic ‘List subpages in WordPress navigation menu’ is closed to new replies.