Plugin to remove top category or page dropdown link in WordPress

Oct 18, 2011 by

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 and performs a nice demo site for my plugin!) then it may very well be that the item that forms the top menu item 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
E-Commerce Testimonials

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!

Filter Top Menu

Related Posts

Tags

Share This

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>