I received a question about how to hand a menu in WordPress. This is a common question (even I had asked it when I first started out) – I though I would take a minute and let you all know about it in case you come across the need to do something similar. While WordPress Menus support this type of action, it is a little bit of aworkaroundd – you will see what I mean…
Wendy wrote:
Hey Paul – can you help me? I want to have a top-level menu item NOT do anything. It is really there just for show and to categorize the items underneath it. I think have have to have a page (or something there) so I can put it on the menu, but I do not want it to be clickable. Can you help me with this?
Of course, I can help you, Wendy!
First just so we are on the same page (and so everyone else understands, this is what Wendy wants to happen:
This is a menu item that when you put the mouse over the top-level item, “Types of Dogs”, the various types get listed below. Each one of these is a page (or a post) on your site. Click on any of them and you will be directed to that page.
However, in Wendy’s case, and anyone else who wants to do this, she does not want to make Types of Dogs clickable. She could create a page titled, “Types of Dogs” that when clicked, it will be shown. In this case, she only wants it to be a place holder. I ahve done this many times.
When you create the menu (Appearance / Menu) you end up with something that looks like this (the OLD way…):
Notice that the top-level entry is a page. That is why clicking on it will bring you to a page. This is NOT want we want; it has to be handled a little differently. Instead of using a Page and adding that as your tot-level item, create a Custom Link item:
For the URL, simply put in the pound sign (or hash – whatever you like to call it). Add this to you menu using the button. This will add the item to the bottom of your menu.
You will see that this is a Custom item, and not a Page like the previous item. At this point, delete the Top “Types of Dogs” Menu item (the one that is a Page) and drag-n-drop the Custom”Types of Dogs” item to the top. You will have to re-indent the sub-level pages.
Save your menu. But wait! We are not yet done. But do not take my word for it. After you save your menu, try it out! See what happens when you refresh your page and click on the Types of Dogs item. Chances are you will get an error! Let’s fix that, shall we? To do so, click on the little arrow to the right of Custom and delete anything that is in the field for URL:
Save the menu after deleting the contents of URL and you will get the results you wanted! Your Top-level menu item will not be clickable!
Now, you may say to yourself, “Why not just leave the URL blank when first creating the Custom Link for the menu?” Great question! The only reason I can give you is that in order to save the custom link, you have to have something in that field. SO, we just put a character, save it, and then go in and delete it once it is in the menu!
Jill says
I’ve never even thought to do anything this fancy on my blog! Is this even possible in Blogger?
Paul says
If you have submenus, it certainly is one way to do things.
Barbara Radisavljevic says
It’s too late for me, unless I start a new WP site. Wish I’d known this about two years ago. I wound up writing a short page that fit the menu word so there would be something to read that was related if someone clicked. I had planned to then link to all the posts under the tab in that post. I just haven’t made the links yet. I’m going to bookmark this for future reference.
Paul says
You can do this on an existing site, Barbara. No need to wait for a new site.
Martha says
That is so cool! Can this be added to a WP blog already up and running? I’ll have to give this a try if it can. Thanks for your great expertise as always!
Paul says
Yes it can!
Hannah Schadel says
Hi Paul,
Thankyou so much for your advice. I have followed this carefully, however for some strange reason nothing shows up on my navigation menu. I have tried it so much times using different ways and it is still not showing up and it is not clickable (as nothing is even there).
Do you know what could be going on here?
Paul says
Every theme is a little different What theme are you using?
Sarah Sinclair says
Thank you so much – just what I needed!! 馃檪
Paul says
You are welcome!
barbara says
Thank you very much! It worked like a charm.
Paul says
Glad to help, Barbara!