Menu in sidebar: grandchildren show wrong menu
-
Hi everyone,
I’m setting up a corporate page using WordPress as a CMS and I have a slight problem with sub-sub pages (grandchildren).
First of all, you can see the site here: https://dev.nunis.net/click/about/who-we-are/
As you can see, I have a parent menu in the header, which is fine.
I then I have child pages in the sidebar, which is also fine. The sidebar uses this code.<?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <h2>In this section:</h2> <ul id="submenu"> <?php echo $children; ?> </ul> <?php } ?>
The problem now is that when you go into a grandchild page (such as ‘Management’), you can no longer see the parents in the sidebar. Obviously what I want is to show all children and grandchildren for the respective parent chosen from the header.
Can anyone please help with this? I’d so much appreciate it.
- The topic ‘Menu in sidebar: grandchildren show wrong menu’ is closed to new replies.