Installation
- Download the current version from here
- unzip the archive. this will create a folder called wp-pagesnav
- Upload that folder to your wordpress plugins folder `wp-content/plugins/`
- Activate the plugin on the WordPress Admin plugin screen
- Add the following sample styles to your themes styles.css file
/* Pages Nav */ #pages_nav { margin:10px; padding-left:15px; padding-right:15px; } #pages_nav ul { background-color:#3F80B6; margin:0px; padding:0px; border: solid 1px white; font-size:1.25em; list-style: none; } #pages_nav ul.level2 { background-color:#5497CE; } #pages_nav ul.children { background-color:#6BADE1; } #pages_nav li { margin: 0px; padding-top:3px; padding-bottom:2px; padding-left: 5px; padding-right: 5px; border-left: solid 2px white; display:inline; } #pages_nav a{ color:white; font-weight: bold; } #pages_nav li.current { padding-top:0px; padding-bottom:0px; background-color:white; border:solid 1px #3F80B6; } #pages_nav li.current a{ color:#3F80B6; }the file styles.css in the plugin folder also contains the sample css styles.
- Add the following code to your theme:
<div id="pages_nav"> <?php if(function_exists("wp_pages_nav")) { wp_pages_nav("show_all_parents=1&sort_column=menu_order"); } ?> </div>the file template-source.php also contains the sample code.
- Change the parameters of the call to wp_pagesnav() in your theme to fit your needs. Have a look at the section parameters to find out how you can tune wp_pagesnav to fit your needs.
Also tune the wp_pagesnav css style to match your theme.
Parameters
- show_all_parents
If show_all_parents is set then the navigation will get larger and larger
the further down the page hierarchy you navigate.
Default:0
accepted values: 0 or 1 - show_root
If show_root is set then also the top most pages are displayed.
Default: 1
accepted values: 0 or 1 - current
If current is set to a value other than -1 wp_pages_nav uses that value as the currently viewed page ID even if the currently viewed page is a different one.
Default: -1
accepted values: page ID - home
If specified a page with this value as the post slug will link to your site url (homepage).
Default:’home’
accepted values: page title - list_tag
If set to 0 suppress the initial <ul> this lets you add static links to the beginning of the navigation.
Default: 1
accepted values: 0 or 1 - depth
How many levels of pages to drill down to. For example if set to 0 wp_pagesnav won’t display any pages at all.
If set to 1 wp_pagesnav will only display the root pages.
Default: -1
accepted values: a number greater 0 - show_parents
if set to 0 don’t display the parents of the current page.
Default: 1
accepted values: 0 or 1 - show_children
if set to 0 don’t display the children of the current page.
Default: 1
accepted values: 0 or 1
Also all of the parameters of the get_pages function are supported. Which are:
- child_of
Only select pages which are a child of child_of. Default: 0 - sort_column
Database column by which to sort the pages. Default: post_title - sort_order
Wether to sort ascending or descending. Default: ASC - exclude
Pages to exclude Default: none

Great plugin! Now is there a way so that the children will show up right underneath their parent, instead of at the end of the list of links?
IE:
- One
– Sub One
– Sub Two
- Two
– Sub One
I agree with Brian and an looking for the same vertical configuration.
Hi John, Brian,
OK, I’ve had a people wanting that feature, so I’ve put it on my todo list.
Not quite sure when I’ll get around to it though.
Regards
Adi
Great plugin !! Exactly what I was looking for.
I use it in my pages.php file
you beauty!
(btw, your current version still has a version number of 0.0.1 in the plugin)
I was glad to see this plugin…
but after testing it appeared that it couldn’t work as a vertical menu. What a pity. 

I hope that we all will see this feature very soon
In documentation it is said:
“home
If specified a page with this value as the post slug will link to your site url (homepage).
Default:’home’”
I don’t get it. Specified in where? I don’t know what to change in settings or somewhere else to define a page for ‘home’.
Hi Serola,
if you add something like this home=index to the wp\_pages\_nav call and then add a page index wp_pages_nav will set the link on that page to the blogs url.
adi
Thanks for great plugin!
However, I can make highlighting active menu items work. Why does the plugin generates code like this:
I’m sorry! I meant code like this:
Page
Title
Thank you Adi,
Now it works like a dream. I just didn’t understood that I have to create an empty page with the title ‘home’, ‘index’ or what ever I want to be displayed as a link for main page. This is an excellent plugin. Thank you very much
hi !
How do i stop long menu items splitting in two?
I would like the item to go to the begining of a new line.
Home something something2 something3 …. something9
When the navmenu line fills up, at some point you get some then thing9 on a new line.
How can i make sure no broken navmenu items display,
if it doesnt fit, i want a new line to start ?
thanks
If you assign a “front static” page, and use another page to hold your posts, but the page where all my posts actually appear never is highlighted with the current class.
Why is this?
AD, I expected the nice kind of “brick wall” layout for the page navigation, but all I got was a bulleted list of page names/links. On a test blog I installed according to your instructions using the default theme (wp 2.02), put the style sample in the end of style.css and the function call part at the end of header.php
Did I miss something?
p.s. “your theme” under install step 6 is a little bit unclear, one wonders where. d.s.
Sorry, but is possible setting current page for post category?
Is there a way to list custom fileds of a page near the page name in a menu…
Great plugin, I just have one question: Is there any way to order the pages that you want listed? Instead of all the pages just being ordered either ASC or DESC, can you list what pages, and what order you want them in?
Thanks!
Nice plugin (I’ve used it before!)
I’ve just tried enabling it on a WP2.2 site and am told: ‘Plugin could not be activated because it triggered a fatal error.’
Should it work on 2.2?
Cheers.
Hi Adi,
Your plug-in works wonders. We’re currently implementing and tweaking it on this site. I have a couple questions, though, and it would be great if you could get back to me:
1. How do I exclude certain pages from the navigation? Let’s say that pages with IDs 23 and 24 should not appear on the menu. I’m trying to use ‘exclude=23,24′ within the wp_pages_nav call in the header code, but no success.
2. If a user navigates from parent to child, how can I make sure that the parent page link stays “illuminated”, so the user knows which page and section of the website he is on? I think this concerns the stylesheet. Can you offer some advice?
Thanks,
- kevan
Yah this really is a great plug-in. Two of the features mentioned above
1) Child Pages show up right under their parent
2) Ability to sortby ID rather than just ASC/DESC would be great.
Actually, I figured out how to sort…..now if I can just get the child pages to show under their parent. That would ROXOR!
Could I add my vote to child items showing under their parent. As it stands at the moment I think I might have to use a different plugin as I really need this functionality. It would be great if the code generated could look something like:
Home
Blog
Countries
England
Scotland
Wales
Contact
I have a front page set to static page “Home” and a
tab called “Blog” to show my posts. But the blog tab doesn’t highlight when it is the current item. How do I fix this?? Thanks so much!
Hi Adi,
thanks a lot! The plugin works great but I had the same problem as Rebecca. When I set the Articles page to be another one than home, then I can’t get it highlighted as “current”.
I guess it depends from the lack of page title as the Article page is NOT properly a page as any other one..
But still I can’t get out from this issue…
Hope you can help. And If you can’t thanks anyway for the great job.
Matteo
Thanks so much for this. While you unfortunately did not manage to save me past days worth of headaches, you managed to save me any future headaches. Greetings from Denmark.
I am having the same problem at Rebecca and Matteo. It seems my nav highlights all the selected pages, but the page I use to post from doesn’t highlight when selected.
Link
Notice how PVTA NEWS AND EVENTS doesn’t highlight when its page is selected.
I have successfully used this on some themes but I cannot seem to get it to work on the dkret3 theme. Is there something specific in the style.css of the theme that stops the sub pages from being show in the nav bar .
[…] Plugins and information Comment on Documentation by Rebecca I have a front page set to static page “Home” and a tab called “Blog” to show my posts. But the […]
I have figured out how to make child pages drop down to a second row beneath the parents. Just change
toTo also highlight the parent when viewing one of its children, add this:
(or whatever colors you’re using)
Re: #6 - add following code to your theme. To what file in the theme?
[…] page nav : […]
How do i get it to show the parent and associared children from the current page? so the current page is child1 the output should look like…
parent1
child1ofParent1
child2ofParent1
or
when another page is selected
parent3
child1ofParent3
child2ofParent3
child3ofParent3
so only parent1 or parent3 from the root shows based on the currently selected page, not all root pages?
Something’s fishy…
In the case when the “Main” page is selected as “static”, the thing doesn’t work properly.
On my site, the blog is in it’s own page “Blog” with URI being /blog/ .
But the “current” value doesn’t work for this page!
[Sorry, I wish i could keep the sample of the error running , but in a few minutes will change it, by deleting your plugin. It looked very promissing for a while!] :-((
Does the plugin work for WP 2.5? Greets!
This is not working at all for me! Displays nothing. Even took out the if statement. On WP 2.5.1
here’s a link. in the view source there’s just an empty div.
Any ideas?
I’d also like the option of child menus displaying directly underneath their parents. Without this option the plugin is really only useful for horizontal navs.
Wp-Menu (slighly different)
Hi Jorg,
if it would be easy for you and you’d like to,
have a look here and tell us what you think about this
wordpress.org/support/topic/181579
I guess I’m not the only WP_user who’d appreciate
your abilities.
thanks here, frank
I too am trying to show the parent of the current child page, the same as James Rodgers. He wrote:
How do i get it to show the parent and associared children from the current page? so the current page is child1 the output should look like…
parent1
child1ofParent1
child2ofParent1
or
when another page is selected
parent3
child1ofParent3
child2ofParent3
child3ofParent3
so only parent1 or parent3 from the root shows based on the currently selected page, not all root pages?
Has htere been any success in achieving this?
cheers for the great plugin.
Hi fibaby,
WP-PagesNav doesn’t support what you want. Have a llo at wp_list_pages which is part of the standard WP install. That should do what you want.
adi
anyone know how to flip the list so that the children are on top and the parents are on bottom? I moved the code to output the parents after the code to output the children. Works great when you are on a parent page, but when you click the subpage, it flips back. Any ideas?
i figured it out… just comment out the line that says…
$parents = array_reverse($parents);
ok, new question… when clicking on a parent, how would one default to the first child page of that parent? So in effect if I click on Parent link 1, it would go to child 1 of parent link 1.
Kevan:
To exclude a page use
wp_pages_nav("show_all_parents=1&sort_comVVU&FW"fW6VFS"".Instead of the number ‘2′, used in that example, you’ve to fill in the page ID of the page you want to exclude. You can find that ID within the MySQL Database.
Unfortunatly the menu is not shown on the page you excludet.
‘wp_pages_nav(”show_all_parents=1&sort_column=menu_order&exclude=2″)’
Hi, great plugin, i maanaged to exclude some pages, but then when i’m inside one of those ‘excluded’ pages the menu won’t show anymore.
Is there a way to show it anyway?
Thanks,
Gio
[…] mit horizontalem Hover-Menü - pageMash - pageManagement - WP Pages Only - CMS-Like Admin Menu - WP-PagesNav - Fold page […]