Title: WordPress Top Navigation Bar Hack
Last modified: August 18, 2016

---

# WordPress Top Navigation Bar Hack

 *  [Liew Cheon-Fong](https://wordpress.org/support/users/lcf/)
 * (@lcf)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/)
 * **What it does?**
    Add a navigation bar under template header image. The navigation
   bar has a tab that link to blog URL and auto add WordPress â€˜pagesâ€™ link tabs.
 * Link: [http://www.liewcf.com/blog/archives/2005/05/wordpress-navigation-bar/](http://www.liewcf.com/blog/archives/2005/05/wordpress-navigation-bar/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [xerocool](https://wordpress.org/support/users/xerocool/)
 * (@xerocool)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-200110)
 * Nice hack! 🙂
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-200111)
 * This looks handy for default users. If a guy has more pages than are going to
   be linked from the hnav – what happens then ?
 *  Thread Starter [Liew Cheon-Fong](https://wordpress.org/support/users/lcf/)
 * (@lcf)
 * [21 years ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-201023)
 * [@root](https://wordpress.org/support/users/root/): I will write a navigation
   bar plugin then 😉
 *  [Denis de Bernardy](https://wordpress.org/support/users/denis-de-bernardy/)
 * (@denis-de-bernardy)
 * [21 years ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-201024)
 * What would really be cool would be a navbar manager plugin with:
 * – the three relevant template tags for header nav, sidebar nav, footer nav
    –
   an admin menu to add resources (e.g. pages, cats, links…) to the nav menus, including
   changing their order (independant from a nav menu to another), their navbar title(
   idem), and sub menus
 *  [brente](https://wordpress.org/support/users/brente/)
 * (@brente)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-201112)
 * This is a great top nav hack. But, if you have pages with sub-pages underneath,
   it breaks all over the place.
 * But I emailed the author for a fix for this, and he sent me this code, which 
   only shows the 1st level page titles.
 * **Find this code:**
 * `<?php wp_list_pages('title_li='); ?>`
 * **Then replace it with:**
 * `<?php wp_list_pages('depth=1&title_li='); ?>`
 * The depth is to set how many level of pages to be displayed in the
    list. Enjoy.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-201113)
 * With all due respect to the author – you could have found that info by reading
   about the relevant template tag in the Codex:
    [http://codex.wordpress.org/Template_Tags/wp_list_pages](http://codex.wordpress.org/Template_Tags/wp_list_pages)
 *  [Denis de Bernardy](https://wordpress.org/support/users/denis-de-bernardy/)
 * (@denis-de-bernardy)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-201114)
 * There is something much more powerful when it comes to creating a nav bar:
 * [http://www.semiologic.com/projects/sem-theme/](http://www.semiologic.com/projects/sem-theme/)
 * Follow these simple steps:
 * 1. Copy the config.php file from one of the bundled themes and drop it — edited
   as necessary — into your theme’s directory.
 * 2. Activate the Semiologic CMS plugin
 * 3. Call sem_header_nav() and sem_footer_nav() in your template.
 * These will populate your nav bars with the best match between:
 * – internal pages
    – categories – arbitrary links
 * e.g.:
 * $sem_header_nav[‘Home’] = get_settings(‘home’);
    $sem_header_nav[‘Blog’] = ‘blog’;
   $sem_header_nav[‘Gallery’] = ‘gallery’; $sem_header_nav[‘Links’] = ‘links’; $
   sem_header_nav[‘About’] = ‘about’; $sem_header_nav[‘Contact’] = ‘contact’; $sem_header_nav[‘
   Somewhere’] = ‘[http://wherever.com&#8217](http://wherever.com&#8217);;
 * and calling sem_header_nav populates your header nav as appropriate.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘WordPress Top Navigation Bar Hack’ is closed to new replies.

## Tags

 * [bar](https://wordpress.org/support/topic-tag/bar/)

 * 7 replies
 * 6 participants
 * Last reply from: [Denis de Bernardy](https://wordpress.org/support/users/denis-de-bernardy/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/wordpress-top-navigation-bar-hack/#post-201114)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
