Menu doesn’t show child pages | wp_list_pages
-
I am using this code to list pages in the menu.
<?php wp_list_pages('depth=1&title_li=&sort_column=menu_order&excludetree=');?> </ul> </li> <ul id="submenu"><li><?php /*https://codex.www.ads-software.com/Template_Tags/wp_list_pages#List_subpages_even_if_on_a_subpage*/ if($post->post_parent) $children = wp_list_pages("title_li=&child_of=&sort_column=menu_order, post_title".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?></li></ul> </div>
The idea is for the menu to show the parent pages and it’s children. It works on the parents page: https://www.metaphorm.org/new3/bio/ but if you go to a child page they disappear: https://www.metaphorm.org/new3/bio/artist-statement/
Obviously PHP is not my strong point.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Menu doesn’t show child pages | wp_list_pages’ is closed to new replies.