WordPress.org

Ready to get started?Download WordPress

Forums

Disable menu items (8 posts)

  1. the1path
    Member
    Posted 2 years ago #

    Hi,

    A WP user recently asked me if there was a way to disable menu items rather than deleting them.

    The menu is fairly substancial and I created the structure for it. They wanted to keep the structure but not have the empty pages show in the menu. So they asked if it was possible to simply disable them?

    Does anybody know of a way of doing this?

    Ta

  2. You mean on the front end of the site?

    You can customize them via Appearances -> Menu as you want.

  3. Kristy
    Member
    Posted 2 years ago #

    I'm looking for the same thing & have the same problem as the1path - "The menu is fairly substancial and I created the structure for it"

    Thanks for the reply Ipstenu.. but for customising menus, right now if you do not want an item to appear in the menu, you only have the option to delete it. However, I would rather be able to "disable" so that the user can easily "enable" it if they want it to appear.

    Is there a plugin for this?

  4. No, there's no plugin for that. But ...

    In the appearance menu, click on 'Screen Options' and under Show advanced menu properties check the box for 'CSS'

    Then when you add items, you can see 'CSS Classes (optional)' - Make a class in your style to display nothing (like .menu-hidden {display:none;}) and call that there.

  5. bakaburg1
    Member
    Posted 2 years ago #

    @Ipstenu, using css you can only hide it visually, but if someone check the html the menu item is still there, as well the anchors with the links. (eg Search Engines and crawlers)

    What is needed is a way not to output the html at all. It's a feature present in many CMS.

  6. Heavens. 9 months later.

    If you don't want to output the HTML, remove the items. I know, you don't want to, but think of it this way: All the enable/disable does is add an item to the menu. It's just incorporating the menu in an all in one interface, rather than WP's drag and drop.

    It's just user preference. Teach your users how to use the product, rather than trying to shove the product into a small box :) Everyone will be better off in the long run.

  7. bakaburg1
    Member
    Posted 2 years ago #

    It's a feature present in many CMS, like joomla. I don't think is totally useless!

    Imagine you have a complex item with many subitems and submenu, but you want to disable it for a while or while the related pages are not ready yet. With the actual method you have to cancel it totally and then rebuild it from scratch!

    I think is a very simple and no brainer feature! just a "display" checkbox would be enough! (it could be also usefull for plugin developers).

  8. bakaburg1
    Member
    Posted 2 years ago #

    There is an API to hack the menu builder interface? If yes, then I could build a plugin for it!

    (i also want to add other functionalities to the menus)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags