Title: Theme Sub Menu
Last modified: August 19, 2016

---

# Theme Sub Menu

 *  [mrtom1981](https://wordpress.org/support/users/mrtom1981/)
 * (@mrtom1981)
 * [15 years ago](https://wordpress.org/support/topic/theme-sub-menu/)
 * I am trying to make a sub navigation in the side bar, I have tried all the code
   on the codex and nothing is working. What i want is when i am on the home page
   in the side bar it will display all the children for the home page.
 * I havent anything live for you to look at online, the menu is called Main and
   i have set the following pattern
 * Home
    -child page 1 -child page 2
 * About us
    -child page 1
 * I need it to be dynamic so when i add new sub pages it will automatically add
   them to the side bar. I want it to be built into the theme rather than use a 
   plugin.
 * I have looked all through this forum and nothing works help would be great.. 
   I have this bit of code that displays the the navigation, but all the main nav
   as well as sub pages
 * `<?php
    $children = wp_list_pages('title_li=&child_of='.$page->ID.'&echo=0');
   if ($children) { ?>
    -  <?php echo $children; ?>
 *  <?php } ?>

The topic ‘Theme Sub Menu’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [mrtom1981](https://wordpress.org/support/users/mrtom1981/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/theme-sub-menu/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
