During my escapades with WordPress and various templates we’ve put together and worked with, I’ve discovered an interesting problem with a number of the DHTML menus that are generated from the WordPress categories or pages (using wp_list_categories or wp_list_pages).
If you have a hierarchical page system (which this blog does not, but www.kabarty.com.au does – and performs a nice demo site for my plugin!) then it may very well be that the item that forms the top menu item (in the case of Kabarty’s site, almost all of the top menu items) is not actually a page you want people to be able to visit – but WordPress forces all Categories or Pages to be clickable links when they’re returned through wp_list_categories or wp_list_pages.
Take for example the following menu structure;
|Home||Marketing & Design||Company|
|Web Site Design||About Us|
It’s highly likely that the menu items Marketing & Design and Company do not need to have pages of their own, but because the DHTML produces a drop down menu, they still need to be clickable links, so that the menu will drop down when you hover over the top.
This is where my plugin comes in. It will alter the destination urls for the top menu items (ie, Marketing & Design and Company) so that instead of going to a page they actually just go to ‘#’ – which most browsers will simply ignore when you click – but still allows the browser to display the drop down menu when you hover over the item.
To install the plugin, first determine if you’re working with categories or pages, and then download the appropriate plugin below. Install it into your WordPress installation in the normal way. Go to your Administration for WordPress, choose Filter Top Menu under the Settings and enter the page/category numbers of the pages/categories that you wish to not have actual pages. It’s that simple!
If you have any questions, please just ask!