Title: Drop downs not working
Last modified: August 20, 2016

---

# Drop downs not working

 *  Resolved [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/)
 * Any idea why this code won’t work to create drop downs on the Services tab on
   this site — I’ve used this many times before:
 * thestudio88.com
 * I’ve set the Parent page to Services for the 3 sub pages.
 * Used this code — I double checked the page ID and it’s correct.
 *  <div class=”topnav”>
    - <?php wp_list_pages(‘include=4&title_li=&depth=1’);?>
    - <?php wp_list_pages(‘include=16&title_li=&depth=1’);?>
    - <?php wp_list_pages(‘include=29&title_li=&depth=1’);?>
    - <?php wp_list_pages(‘include=13&title_li=&depth=3’);?>
    - <?php wp_list_pages(‘include=6&title_li=&depth=1’);?>
    - <?php wp_list_pages(‘include=9&title_li=&depth=1’);?>
 *  <div class=”clr”></div>
    </div>
 * Thanks much in advance!

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/drop-downs-not-working-1/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/drop-downs-not-working-1/page/2/?output_format=md)

 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266721)
 * Each of those calls to `wp_list_pages()` will only show one page as you only 
   have one page ID in the include parameter.
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266722)
 * I thought the depth=3 will pull in the sub pages under the Services page? I’ve
   used this code before….??
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266724)
 * Oh, so I have to include the ID of the other pages….right!
 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266725)
 * Yes thats right. I am confused as to why you all the instances of wp_list_pages.
   Could you not just include it once?
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266727)
 * 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)?
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266728)
 * 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?
 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266729)
 * 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.
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266731)
 * 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.
 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266732)
 * 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.
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266735)
 * 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.
 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266739)
 * The best way is to implement the `wp_nav_menu` into your theme and then you can
   have full control.
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266740)
 * Where do I implement that?
 * In the header.php?
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266742)
 * 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?
 *  [Equal](https://wordpress.org/support/users/equalmark/)
 * (@equalmark)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266744)
 * A good starting point for wp_nav_menu is here:
 * [http://codex.wordpress.org/Function_Reference/wp_nav_menu](http://codex.wordpress.org/Function_Reference/wp_nav_menu)
 *  Thread Starter [Sculley](https://wordpress.org/support/users/sculley/)
 * (@sculley)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/#post-2266748)
 * Okay, thanks. Let me take a look.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/drop-downs-not-working-1/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/drop-downs-not-working-1/page/2/?output_format=md)

The topic ‘Drop downs not working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 18 replies
 * 3 participants
 * Last reply from: [Sculley](https://wordpress.org/support/users/sculley/)
 * Last activity: [14 years, 12 months ago](https://wordpress.org/support/topic/drop-downs-not-working-1/page/2/#post-2266809)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
