non-clickable placeholder in the menu

well, I really would like one & more of my top-level menu items (parent menu items that has child menu items) to be non-clickable, so that visitors can only click on the child menu items…could be very nice for a horizontally positioned menu.

any plugin out there that can do the trick (or trick or hack or….)?

Related posts

Leave a Reply

3 comments

  1. Yes, this is possible by adding a custom link to the menu assigning it any url (for this example I just added #) then click add to menu. Once it’s on the menu open it and remove the url you assigned and save. If you don’t put the url initially WordPress won’t let you add it to the menu. On your pages you will be able to hover over it and the drop down children will appear but you wont be able to click on the parent “place holder”.

    alt text alt text

  2. “#” or even “” or even nonexistence of an href attribute of an element still in most browsers makes the element clickable. So previous response will not work 100% It depends on your theme menu and your needs/abilities how to handle the code. There are 2 basic options if you do not want to change whole menu code:

    • replace element on apropriate places (on top + on parent links) with something like or but this can lead to necessity of major css editing.

    or

    • on those places include in element this attribude:

    onclick=”return false;”

    It will work in all major browsers well. You can add styles to make an arrow cursor, disable underlines and so on.

  3. I like the plugin Disable Parent Menu Link.
    I found an issue when I tried the blank-url-in-the-cusom-menu trick above due to my permalink structure — had do do with it not being a page yet I wanted it to function as a parent? Can’t quite recall, but went back to the plugin.