Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Custom Menu Wizard Widget

Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.

If you have a question or problem that is not covered here, please use the Support forum.

Are there any known problems/restrictions?

Yep, 'fraid so :

  1. The widget will only recognise one "current" item (prior to v2.0.2 it was the last one found; as of v2.0.2, it's the first one encountered, but v3.1.5 adds a switch that lets you opt for the last one found). It is perfectly possible to have more than one menu item marked as "current", but if CMW has been configured to filter on anything related to a "current menu item" it can only choose one. The simplest example of multiple "current" items is if you add the same page to a menu more than once, but any other plugin that adds and/or manipulates menu items could potentially cause problems for CMW.
  2. The widget's "assist" uses jQuery UI's Dialog, which unfortunately (in versions 1.10.3/4) has a really annoying bug in its handling of a draggable (ie. when you drag the Dialog's title bar to reposition it on the page) when the page has been scrolled. It is due to be fixed in UI v1.11.0, but meantime I have defaulted the Dialog to fixed position, with an option to toggle back to absolute : it's not perfect but it's the best compromise I can come up with to maintain some sort of useability.

Why isn't it working? Why is there no output?

I don't know. With all due respect (and a certain amount of confidence in the widget) I would venture to suggest that it is probably due to the option settings on the widget/shortcode. The quickest way to resolve any such issues is to use the widget's interactive "assist", and ensure that you set the current menu item correctly for the page(s) that you are having problems with. However, I am well aware that I not infallible (and it's been proven a fair few times!), so if you still have problems then please let me have as much information as possible (the shortcode equivalent of your settings is a good start?) and I will endeavour to help.

Please note that simply reporting "It doesn't work" is not the most useful of feedbacks, and is unlikely to get a response other than, possibly, a request for more details.

I should also point out that any other plugin can change any menu, at any time, either before or after this widget does it stuff (even prevent it running at all!), so it's possible that the problem lies somewhere other than CMW.

Where is the styling of the output coming from, and how do I change it?

The widget does not supply any output styling (at all!). This is because I have absolutely no idea where you are going to place either the widget (sidebar, footer, header, ad-hoc, etc?) or the shortcode (page content, post content, widget content, custom field, etc?) and everyone's requirements for styling are likely to be different ... possibly even within the same web page's output. So, all styling is down to your theme, and if you wish to modify it you will need to add to (or modify) your theme's stylesheet.

The safest way to do this is via a child theme, so that any changes you make will not be lost if/when the main theme gets updated. The best way to test your changes is by utilising the developer capabilities that are available in most modern browsers (personally, I could not do without Firefox and the Firebug extension!) and dynamically applying/modifying styles, possibly utilising the custom classes that the widget applies to its output, or the Container options for a user-defined id or class.

Why is there no (or, How do I get...) indentation on my hierarchical menu?

Firstly, see the answer above, re: styling of the output.

Any output styling comes from your theme (or possibly some other plugin, but definitely not CMW).

If other nested lists are displayed with indentation then it is likely (but not guaranteed) that there is a class that can be applied to the CMW output that may result in the desired effect. It is always worth checking out WordPress's own Nav Menu widget, on a menu that has sub-menus : if that has indentation then check the classes it has and try them on CMW (assuming that they're not already there!). If it doesn't have indentation then you're probably going to have to add your own styled class(es) to your theme, and then apply them to CMW.

Note that quite a few themes "reset/standardise the CSS", by removing all padding and margins from lists : trouble is, some of them don't then provide any means for indenting nested lists. Also, please be aware that any CSS rules that are provided may be location-specific. So, for example, a class may indent nested lists when they are in a sidebar widget area, but not when they're in a footer widget area or inserted within content (using a shortcode).

Purely as an example, [re-]applying indentation to nested unorder lists (ULs) could be as fundamental as ...

ul ul { margin-left: 1em; }

...however, I have found that things are generally never that straightforward, particularly when menus with links in them are involved, so I'm afraid you might have to experiment a bit.

How can I create a horizontal menu?

Firstly, see the answer above, re: styling of the output.

Any output styling comes from your theme (or possibly some other plugin, but definitely not CMW).

If you simply want all the menu items to flow horizontally across the page then you could start with something along the lines of...

.menu-widget {
    list-style-type: none;
    margin: 0;
    padding: 0;
.menu-widget li {
    display: inline-block;
    margin: 0 2em 0 0;

This is purely an example.

I've used a class : you may want to change/add to the class, or swap it for an id. There are a number of other ways to do it - especially if you have multiple levels, or you want vertical sub-menus, and/or any sort of interaction. You may want to bring in a jQuery script, or another WordPress plugin, to handle it for you, assuming that your theme doesn't already provide the functionality you need.

How do I use the "assist"?

The widget's interactive "assist" is specific to each widget instance. It is a javascript-driven emulator that uses the widget instance's option settings - including the menu selected - to build a pictorial representation of the menu and show you, in blue, which menu items will be output according to the current option settings. It also shows a very basic output list of those menu items, although it will not apply some of the more advanced HTML-modifying options such as can be found under the Container, Classes or Links sections. Any of the displayed menu items can be designated as the "current menu item" simply by clicking on it (click again to deselect, or another item to change). The "current menu item" is shaded red, with its parent shaded orange and ancestors shaded yellow. All changes in the "current menu item" and the widget options are immediately reflected by the "assist" (text fields in the widget options simply need to lose focus).

The red cross to the left of each menu item toggles the Exclusions setting for the item and/or its descendants. The button has 3 settings :

  • Off (dimmed)
  • Just this item (white on red)
  • This item plus all its descendants (white on red, with a small yellow plus sign)

Just click through the toggle states. When the Primary Filter is set to "Items", the green tick buttons to the right of each menu item work in the same way.

Note that if a green "Alternate settings" message is showing then the ticks and crosses buttons will show the approriate Alternative settings but they will be slightly opaque and they will not be clickable!

Once you are happy with the results, having tested all possible settings of "current menu item" (if it applies), then simply Save the widget. If you are using a shortcode implementation, then copy-paste the shortcode text - at the base of either the "assist" or the widget form - straight into your post.

Is there an easy way to construct the shortcode?

Yes, use a widget form. The shortcode for all the selected/specified options is show at the base of the widget (v3+) and the base of the "assist". The widget does not have to be placed within a widget area, it can also be used from the Inactive Widgets area.

Do I have to Save the widget if I am using a shortcode?

Only if (as of v3.1.5) you are using the widget=N attribute, which refers back to an existing widget instance for its settings.

How do I get the menu item ids for the 'Items' option?

Use the widget's interactive "assist" (see above). Within the representative menu structure, each menu item's id is set in its title attribute, so should be seen when the cursor is moved over the item. A simpler way is to check the Items option : the "assist" will then show a green tick "checkbox" to the right of each menu item and you simply [un]check the items as required. Each selection will be reflected back into the widget's Items settings, and also in the shortcode texts.

The more painstaking way is to go to Appearance, Menus and select the relevant menu; hover over one of the edit, Remove, or Cancel links for an item and look in the URL (the link's href) for menu-item=NNN ... the NNN is the menu item id.

How do I get the menu item ids for the 'Exclude Ids' option?

The "assist" shows a red cross "checkbox" to the left of each menu item, and [un]checking the items will reflect back into the options and shortcode texts. Otherwise, it's the same principle as outlined above for Items ids.

What's the difference between including Branch Siblings (or Branch Ancestors + Siblings), and switching to 'Level' instead of 'Item' in the Secondary Filter section?

If you elect to include Branch [Ancestor] Siblings, you will only get the siblings, not their descendants (assuming they have any). On the other hand, if you make Starting at use 'Level' instead of 'Item' then siblings and their descendants will be added to the filter.

For example, let's say that Bravo and Charlie are sibling items immediately below Alpha, and that Bravo is the selected Branch Item, with Starting at set to "the Branch" (ie. Bravo). If you switch from "Item" to "Level" then both Bravo, Charlie, and all their descendants, will become eligible for filtering. If you left "Item" enabled, and switched on the inclusion of Branch Siblings, then Bravo and Charlie would both still be eligible, but only Bravo's descendants would be; not Charlie's!

Can CMW handle menus that have items dynamically added by other plugins?

Ummm ... Maybe.

Unfortunately, I can't answer this with a definitive Yes or No. By definition, if something is "dynamic" then it is likely to change. If the plugin that creates those dynamic items does its job correctly then the items added should have unique ids, at least within the context of the menu being manipulated. Also, those items will probably have been set up with a menu_order property that places them appropriately within the menu structure, and the existing menu items will have been modified accordingly. If that is the case then CMW will be able to process them in the right order & structure.

However, there is a big caveat here : CMW stores item ids wherever a specific item is targeted - such as Branch=Page One, or Items=1,3,5, or Exclusions=2,4,6+, etc. If any one of those ids relates to a dynamically-generated item at the time the widget (or shortcode) is configured, then it is possible that the id may get assigned to a different item, or may not even exist, when it comes to displaying the menu.

As a contrived example, let's say that posts Alpha, Charlie and Echo are dynamically added to a menu, and you can see them when you configure the CMW widget. You decide to Exclude post Charlie, so you configure and save the widget accordingly. Then someone adds or changes post Beta such that it now qualifies for dynamic inclusion into the menu - so, the menu should now contain posts Alpha, Beta, Charlie and Echo. Unfortunately, the ids get re-assigned by the plugin doing the dynamic insertion, and Beta now has the id that Charlie was given when you configured CMW, so Beta gets filtered out and Alpha, Charlie and Echo get shown!

So, my advice would be : If you use CMW with a menu that you know contains dynamically-degenerated items, try to avoid specifically targeting any of those items in the configuration. For example, setting Branch=Current Item is fine, but don't set Branch=A Dynamic Item; and avoid including or excluding specific dynamic items, use a parent item that exists in the menu instead. If you can do that then there should be no problem.

What classes does CMW automatically assign?

Every menu item :

  • cmw-level-N : every menu item gets this class, with N being the hierarchical level of the item within the menu shown (starting at 1). Note that selecting the flat output option does not affect the hierarchical level of any item.

Certain menu items :

  • cmw-current-item : assigned to the menu item that CMW has decided to use as the "current menu item".
  • cmw-has-submenu : assigned to any menu item that has child items in the output menu.
  • cmw-menu-item-had-children : assigned to any menu item that had child items in the original base menu, regardless of whether it still has child items in the final output menu.
  • cmw-an-included-ancestor : assigned to any menu item whose presence is solely due to a request to include ancestors.
  • cmw-an-included-ancestor-sibling : assigned to any menu item whose presence is solely due to a request to include the siblings of ancestors.
  • cmw-an-included-sibling : assigned to any menu item whose presence is solely due to a request to include branch item siblings.
  • cmw-an-included-level : assigned to any menu item whose presence is solely due to a request to include one or more levels.

The menu itself (the outermost list element) :

  • cmw-fellback-to-parent : assigned to the menu when the fallback for Current Item has no children is set to Start at : -1 (parent), and it has been invoked.
  • cmw-fellback-to-current : assigned to the menu when the fallback for Current Item has no children is set to Start at : the Current Item, and it has been invoked.
  • cmw-invoked-alternative : assigned to the menu when the output has been produced as a result of an alternative configuration being brought into play.

The menu wrapper :

  • shortcode_custom_menu_wizard : if the menu is produced from a [cmwizard] shortcode then this class is assigned to the element that wraps the output.

How can I find all my posts/pages that have a CMW shortcode so that I can upgrade them?

There is a button on the widget's "assist" - [...] - that will provide a list of posts/pages whose content, or meta data (custom fields), contains any CMW shortcode. Each entry is a link that opens the item in a new tab/window. The link's title gives a bit more information : post type, id, whether the shortcode(s) are in content and/or meta data, and the shortcode(s) concerned. This utility does not check things like text widgets, plugin-specific tables, theme-provided textareas, etc.

There is also an extension to the shortcode - [cmwizard findme=1/] - that will output the same information, should you not be able to use the "assist" (for some unknown reason). You may optionally provide a title attribute; any other attributes are ignored. Note that output from this shortcode extension is restricted to users with edit_pages capability.

Is Version 2 of the widget, including the old [custom_menu_wizard/] shortcode, still supported?

In Version 3, Yes. However, I highly recommend that you upgrade your widgets & shortcodes to the latest versions, because Version 2 will not be supported beyond Version 3.

Requires: 3.9 or higher
Compatible up to: 4.5.5
Last Updated: 9 months ago
Active Installs: 20,000+


4.9 out of 5 stars


1 of 3 support threads in the last two months have been marked resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

0,1,0 50,2,1 100,2,2 100,1,1
100,1,1 100,1,1
0,1,0 100,1,1
100,1,1 100,1,1