Menu Items Without Links

One thing that’s always bugged me is duplication in menus. WordPress duplicates menu functionality by default. In some cases it makes sense, in others, it muddles the menu hierarchy. For example, my local newspaper’s website offers a menu selection: ‘Entertainment’ The ‘Entertainment’ menu option has 2 purposes. First it links to a page titles ‘Entertainment Home.’ Secondly, it has a sub-menu that contains numerous options: ‘Comics’, ‘Books’, ‘Puzzles’, ‘Events’, ‘Music’, etc… The first option of the submenu is ‘Entertainment Home.’ Wait a minute! That’s the same as the ‘Entertainment’ option! So from my OCD menu structure point of view one of the options is wrong. Either ‘Entertainment’ (a) sits above the sub-menu options or (b) it’s an equal. Fortunately, there are simple solutions for both. Slide1

If ‘Entertainment’ sits above the sub-menu items, simply remove ‘Entertainment Home’ from the sub-menu. Clean and easy.

Now if ‘Entertainment’ is really a peer to the other sub-menu items it’s only a bit more complicated. WordPress will demand the parent menu have a link. So rather than a page, anchor or other such link, let’s tell it to do nothing. We could give the menu item a link of ‘#’. This would not link to a page, but does force an awkward page refresh. Instead, a link value of ‘javascript: void(0);’ accomplishes the goal. The menu now maintains hierarchy.

Leave a Reply