Stopping the parent pages in the navigation bar from being clickable
-
I’ll try to explain this clearly.
In my navigation bar, most of the pages are drop-down menus. What I’d like to do is to not be able to click on the parent page, but just the drop down page.
http://www.museeacadien.org/en/wordpress (temp URL)
Example: The second item in the navigation bar is ‘Exhibitions’ and there’s a drop down menu with 5 items. What I’d like to do is block the Exhibitions page, but making all 5 of the drop-down pages accessible. Basically, I don’t want Exhibitions to be a page at all because I have nothing to put on it.
Is there CSS code I can slip into the Child theme to achieve this? Or is it something simple like a menu? Note that I don’t want to create a secondary menu, I just want categories that have drop-down pages.
Hope that was clear. Thanks a lot everyone, this is a great community.
Admin
Add a ‘custom link’ to your menu, by inserting a dummy URL for the link, something like
http://#
. After you’ve added the link, just go to that custom link in your menu, expand it and delete the URL.I don’t think this solved my problem. We may not be talking about the same thing, but that’s my fault for not explaining myself properly.
Here’s a picture of where I’d like to remove the link:
http://museeacadien.org/en/wordpress/wp-content/uploads/2011/08/Graphene-support-navigation-link.jpg
‘Exhibitions’ is a parent page, but there’s nothing on it. I would like to keep it in the navigation bar, but remove the link: making it unclickable.
If that’s not possible, I’d like to be able to redirect people to another page, like the top page of the drop down.
Thanks again Syahir, maybe what you said is the solution to my problem, but I can’t seem to get a custom menu in my main navigation bar (I can put it just below the nav bar, like a 2nd navigation bar. But not with the other parent pages.)
Mod
Try it this way:
Do what Syahir suggests, but name the dummy link with the name of the parent page you don’t want clickable. It will look like a parent page, it won’t be a link.
Ken
The trick with custom links looks as though it would work with custom menus.
But what if I have a completely auto-generated menu?
Is there a way to add a custom link to that?
Mod
What do you mean by “completely auto-generated menu”? If you mean the default menu that just shows up automatically, then, no. You’d have to create a custom menu to take its place.
If you mean a custom menu where you’ve clicked “automatically add new top-level pages,” then yes, you can.
Ken
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.