Each of those calls to wp_list_pages()
will only show one page as you only have one page ID in the include parameter.
I thought the depth=3 will pull in the sub pages under the Services page? I’ve used this code before….??
Oh, so I have to include the ID of the other pages….right!
Yes thats right. I am confused as to why you all the instances of wp_list_pages. Could you not just include it once?
Yes, so would it be:
<?php wp_list_pages(‘include=4,16,29,13,37,34,406,9,&title_li=&depth=4’);?>
where the sub pages come right after the Parent page (13)?
Woops, depth=4
<?php wp_list_pages(‘include=4,16,29,13,37,34,406,9,&title_li=&depth=4’);?>
Or would it be:
<?php wp_list_pages(‘include=4,16,29,9,&title_li=&depth=1’);?>
<?php wp_list_pages(‘include=13,37,34,406&title_li=&depth=4’);?>
Where first is navs with no drops and second is nav with drop downs?
As far as I am aware if you use the include parameter the depth is irrelevant as WordPress will only include pages you have added to the include parameter. So in the example above it will only includes pages with IDs 4,16,29,13,37,34,406 and 9.
I would think about using the new wp_nav_menu
instead then you have drag and drop control over which pages etc are in your menu.
So they way it determines whether it’s a drop down is by tagging the sub page with a parent page?
Where’s the wp_nav_menu? I’m using a theme that’s not the one installed in 3.2.1.
To be a drop down there would need to be a depth of at least 2 so that it can nest the links in another unordered list. However if you use ‘include’ then the depth will not work unless one of the page IDs you have included is a child page.
Eh gads…..so what’s the right way to do it?
I tried this and it won’t stay in the order I’d like the pages to be.I think that’s why I used all the lis. Is there a simpler way?
<?php wp_list_pages(‘include=4,16,29,13,37,34,406,9,&title_li’);?>
37,34,406 are all child pages of 13. Order not working though.
The best way is to implement the wp_nav_menu
into your theme and then you can have full control.
Where do I implement that?
In the header.php?
Would it be :
<div class=”topnav”>
<ul id=”nav_menu”>
<?php wp_list_pages(‘include=4,16,29,13,37,34,406,9,&title_li’);?>
It won’t display the closing ul here.
</div>
And then style the nav_menu?
Okay, thanks. Let me take a look.