Add this little trick to the DUH category, one of those little things I should have looked up years ago. Very often with WordPress sites you want to create a menu bar based onÂ categories, such as the one below.
Normally to do this you would setup a page or link for each menu item, both top level and sub-menus. But often we don’t want the top level to link anywhere, we simply want it to reveal the sub-menu. A placeholder of sorts.
In the past I did this by creating a blank page in WordPress, adding that page to the menu. The problem with this method is if the visitor clicks on the top level menu the blank page displays, not ideal.
The work around or trick is to add a “custom link” to the menu instead of a page. Then add a simple # symbol in the link field.
This does create a link, but it goes nowhere and in effect does what we want.
If for some reason you don’t see “Custom Links” under Appearance>Menus, you may need toÂ click on “Screen Options” (top right) andÂ turn on.
It’s the little things sometimes…
Leave a Reply