Title: Customising navigation for single.php
Last modified: August 20, 2016

---

# Customising navigation for single.php

 *  [ts](https://wordpress.org/support/users/trmash/)
 * (@trmash)
 * [15 years ago](https://wordpress.org/support/topic/customising-navigation-for-singlephp/)
 * Hello,
 * I’m currently using `<?php wp_list_pages('title_li='); ?>` and `<?php wp_list_categories('
   child_of=X') ?>` to display a menu and submenu structure. Each page has an individual
   template to display posts from the individual category’s children, and ‘X’ represents
   the category ID.
 * Hoping you can help me with the next step though: when viewing a single post (
   single.php) I am unable to display the submenu because I do not know how to detect
   the current post’s category. I also lose the `current_page_item` class from the
   main menu, which affects my styling.
 * Is there a better way to have a navigation that lists pages (with `current_page_item`
   styling) as well as a submenu that automatically detects the current category
   and lists the children, even for single posts?
 * All help appreciated!
 * Unfortunately this site is only running locally at the moment, so I can’t provide
   a URL.

The topic ‘Customising navigation for single.php’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [navigation](https://wordpress.org/support/topic-tag/navigation/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)

 * 0 replies
 * 1 participant
 * Last reply from: [ts](https://wordpress.org/support/users/trmash/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/customising-navigation-for-singlephp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
