Support » Fixing WordPress » Remove Hyperlink From Main Menu

  • This is a difficult one to search for and describe, which is further complicated due to the fact that my site is not live, and is hence not available for reference in this post.

    My problem is this. I am using a Restaurant theme that Features a Navigation Item named Menu, which is generated from posts that are marked either Menu, or a sub-category under Menu (i.e. Breakfast, etc). The sub-menu pages (drop-down under Menu) display perfectly, however the “Menu” page itself displays everything under the Menu Category, or its sub categories. This results in the Menu page being over 50 posts long, which needless to say does nothing to promote an easy navigation of our dishes.

    What I’m looking for is a simple solution to disable the hyperlink in my Navigation Menu for the “Menu” category. When a user hovers over “Menu” I want the sub categories to show up in the drop down, however I don’t want a user to be able to click on “Menu” itself. Basically, force the users to select a sub menu of either breakfast, lunch, etc.

    This is the only solution I’ve been able to come up with, the rest would require significant coding to alter the menu display pages, which is beyond my skills and budget to have someone else do this.

    I think I just need some Custom Function that says if Navigation Menu contains a category menu item named “Menu”, disable it’s hyperlink… if that makes sense.

    Does anyone have any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I don’t mean to bump this, but it is a critical item I’m looking for a solution on. I have since found a few solutions that involve removing a category link, etc. But for the purposes of dynamic navigation hyperlinks, where you only want to remove the parent hyperlink, and not its children category links, these solutions do not work.

    Any help would be greatly appreciated! 🙂

    I need answers on the same issue please – you’re right – a hard one to describe!

    Hey guys. Did you finally find the answer??? I’m seeking exactly same thing…

    Oh, and forgot to say – I’m using wordpress v3.0.1 and theme generated with Artisteer 2.5. Hope someone can share the gold knowledge:) I see that many people still looking around with no result… Perfect solution would be an plugin for managing hyperlinks under each button in menu, but piece of code is also ok:)

    Hi. The first thing I would do is see if the Artiseer software supports WordPress menus. If you can use the WordPress menu system then it would be simple to do what you want.
    You might also want to check in the Artiseer support forums and see if anyone else has tried to do this- it might be a problem that’s already been solved.

    If not here’s what I would do
    Easy but a bit messy: install the ‘redirection’ plugin. If your menu page is ‘/menu’, redirect that to ‘/’. Then if someone clicks menu it just sends them to the home page.

    The non solution solution- on the menu page simply list thecategories with links. This is what most users will expect to see happen anyway.

    Edit some code. You’ll need to find where the menu is built, and add a php if statement, and not add the link or closing tag if the URL contains ‘menu’. This might be done in a functions file, or it might be in some other file. If you want to go this route, maybe the Artiseer folks could at least tell you where the code is located, then you could post the code here and I can suggest what to change.

    I hope that helps.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove Hyperlink From Main Menu’ is closed to new replies.