Title: Subnav on single posts
Last modified: August 19, 2016

---

# Subnav on single posts

 *  [kikaweb](https://wordpress.org/support/users/kikaweb/)
 * (@kikaweb)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/subnav-on-single-posts/)
 * Hello, I’m trying to build a subnavigation for a WP powered website. I’m using
   the bare Starkers theme which should be based on Twenty-Ten.
 * I’ve managed to get a subnav listing all children pages, using the tags provided
   in the docs, so now I have the following code inside my header.php template:
 *     ```
       <?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 && is_page()) { ?>
   
       	<ul id="subnav">
       		<?php echo $children; ?>
       	</ul>
       <?php } else { ?>
       <?php } ?>
       ```
   
 * So now if I’m on the parent page I have a nice subnav listing all my children
   pages, and if I’m on a child page I get all the other children pages listed –
   nice! But my problem is that if I’m on a post single page, ie. mysite.com/parent/
   child/yyyy/mm/post-title/ then no subnavigation bar is shown.
    How can I get 
   a subnav on a single post page? Is it possible to achieve this without any plug-
   in? I’m a complete newbie, and I don’t know much about php or wp-tags, so this
   may be a silly question, but I’ve searched the forum and didn’t find any clue…

The topic ‘Subnav on single posts’ is closed to new replies.

## Tags

 * [navigation](https://wordpress.org/support/topic-tag/navigation/)
 * [Subnavigation](https://wordpress.org/support/topic-tag/subnavigation/)
 * [wp_list_pages](https://wordpress.org/support/topic-tag/wp_list_pages/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [kikaweb](https://wordpress.org/support/users/kikaweb/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/subnav-on-single-posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
