Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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....)?

share|improve this question
1  
@Morten I am glad this worked for you. I also wanted to mention that the goal of WordPress Answers and the other StackExchange sites is to find the best answer to the questions. The answers form is reserved for answers. If you want to make a comment you can click the comment button under your question. Read more about it in the FAQ: wordpress.stackexchange.com/faq Also when you find the best answer to your question you can click the check next to the answer to indicate that. –  Chris_O Sep 8 '10 at 8:24

3 Answers 3

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

share|improve this answer

"#" 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.

share|improve this answer
    
Can you define "most browsers". I have done this and haven't noticed a problem. –  s_ha_dum Dec 4 '12 at 5:42

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.