Problems with pages and navigation
-
Hello,
I’m fairly new to WordPress and this is definitely my first experience using it as a CMS system. I’ve figured out pages, posts, etc., and mostly everything is working. I do, however, have a couple of questions:
The site is at: here
Navigation: I’ve used permalinks for my horizontal menus and wp_list_pages to generate the left vertical menu. What is displayed here depends on what horizontal link is clicked, with the children of that link being displayed.
My problem is dealing with 2nd and 3rd level children. For example, if you go to newcomers you will only see one level of pages. If you then click on Quick Search in the left menu, you can see that several of these “child” pages on the left have “children” of their own, and now they are all displayed.
The way I would like this to work is, when you click on Quick Search you then ONLY see the children of Quick Search in the left menu.
I can see how I could write some code to do this manually by targeting the $post->id, but then if the client adds child pages to any of these, someone will have to modify the code. If possible I would like this to be fully automatic.
Is this possible, and how do I go about it?
The code I’ve used for my menu is:
<ul> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=2"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=1"); if ($children) { echo $children; } else { wp_list_pages ("include=72, 129, 175&title_li="); } ?> </ul>
Thanks in advance,
Matt
- The topic ‘Problems with pages and navigation’ is closed to new replies.