WP Menubar documentation
[Updated October 15, 2010]
Menubar is a WordPress menu plugin that adds one or more configurable menus to your WordPress site. With Menubar you can create both single and multi-level menus, and you can style them with customizable menu templates.
This page contains the updated documentation for Menubar 4.9.
Contents
- Requirements
- Features
- Upgrading procedure
- First installation procedure
- Create your menus
- Configure your menus
- Menubar templates
Requirements
1) Menubar requires WordPress 2.6 or higher.
2) Your theme must include a call to the wp_head() function. Usually this call is made in the header.php file, right before the </head> line. If your theme doesn’t include a call to wp_head(), you should add it yourself, otherwise you’ll get an error like this:
WP Menubar error: Function wpm_display_Suckerfish() not found!
[back to Contents]
Features
With WordPress Menubar:
* you can build fully customized single or multi-level menus with the homepage, the frontpage, categories, category trees, static pages, page trees, tag archives, single posts, a search box, and any static or PHP generated URLs; the currently selected menu item is dynamically highlighted, but you can disable this feature if you don’t like it;
* you can add, edit and delete menus and menu items in an easy to use administration panel, which blends nicely with the existing WordPress administration panels;
* you can specify where to place each menu by inserting in your theme a short line of PHP code; you can also use the included Menubar widget to place a menu in a sidebar or widget-ready area of your theme (only with WordPress 2.8 or higher);
* you can choose one of the available menu templates to style each menu, and you can modify or rewrite the menu templates as you like; the automatic plugin upgrades won’t overwrite your customizations;
* if you deactivate the plugin your menus will disappear, and if you reactivate the plugin your menus will reappear unchanged.
[back to Contents]
Upgrading procedure
Case 1
If you are upgrading to the current version from Menubar 3.1 or higher:
a) From the Plugins administration panel, deactivate the old Menubar version;
b) Delete the menubar folder in wp-content/plugins;
c) Download the plugin archive from the WordPress Plugin Directory and unzip it, then upload the resulting menubar folder with all its contents to wp-content/plugins;
d) From the Plugins administration panel, activate the new Menubar version.
These are the same steps performed by the automatic upgrade procedure, so you can safely run the automatic upgrade. In both cases, all your template customizations won’t be affected.
Case 2
If you are upgrading to the current version from Menubar 3.0:
a) Create a new folder named menubar-templates under wp-content/plugins;
b) Move the Basic and Suckerfish folders with all their contents from wp-content/plugins/menubar to wp-content/plugins/menubar-templates; do the same for all the other Menubar templates you have installed;
c) From the Plugins administration panel, deactivate the old Menubar version;
d) Delete the menubar folder in wp-content/plugins;
e) Download the plugin archive from the WordPress Plugin Directory and unzip it, then upload the resulting menubar folder with all its contents to wp-content/plugins;
f) From the Plugins administration panel, activate the new Menubar version.
Steps c) through f) are the same steps performed by the automatic upgrade procedure, so you could manually perform the steps a) and b), and then run the automatic upgrade.
Case 3
If you are upgrading from Menubar version 1.x or 2.x, just delete the menubar folder in wp-content/plugins, and perform a first installation procedure of the current Menubar version. Please note that menus built with Menubar version 1.x or 2.x will be lost in the upgrade to newer Menubar versions.
[back to Contents]
First installation procedure
To install the current Menubar version for the first time:
a) Download the plugin archive from the WordPress Plugin Directory and unzip it, then upload the resulting menubar folder with all its contents to wp-content/plugins;
b) From the Plugins administration panel, activate the current Menubar version;
c) From the Appearance administration panel you can now access the new Menubar sub-panel.
Steps a) and b) are the same steps performed by the automatic install procedure, so you can safely run the automatic install. In both cases, before using Menubar, you’ll have to:
d) Create a new folder named menubar-templates under wp-content/plugins;
e) Install one or more Menubar templates, at least Suckerfish (see Menubar templates).
Now you can create your first menu (see next section).
[back to Contents]
Create your menus
From the Appearance – Menubar administration panel you can create, edit, and delete menus. Menus are specified with the following fields:
* Name: the name of your menu; will be used to insert the menu in your theme.
* Template: the Menubar template and the stylesheet you wish to apply to this menu. You can also choose to apply a template without a stylesheet, and in this case you’ll have to provide your own CSS rules, e.g. in your theme style.css file. Please note that not all Menubar templates support multi-level menus.
Important: edit your theme inserting the following line of code where you wish to display your menu. If your menu name is mymenu, the line of code to insert in your theme is:
<?php do_action('wp_menubar','mymenu'); ?>
A good starting place to insert the above line of code could be at the end of the header.php file.
Another way to integrate your menu in your theme is to use the included Menubar widget, which allows you to add a menu in a sidebar or widget-ready area of your theme (only with WordPress 2.8 or higher).
Before looking at your new menu, please add at least one menu item (see next section).
[back to Contents]
Configure your menus
From the Appearance – Menubar administration panel you can add, edit, and delete menu items for each of your menus. Menu items are specified with the following fields:
* Order: indicates where this menu item will be placed. Choices are:
- Before…: this item will be placed right before the item you select.
- Child of…: this item will be placed as a sub-item of the item you select; please note that to display a multi-level menu you’ll need a multi-level Menubar template like Suckerfish.
- After…: this item will be placed right after the item you select.
You can later modify the ordering of your menu items using the Edit command or the up and down arrows in the menu items list.
* Name: specifies the name of this menu item as shown in the menu; for instance Home, About, News, Gallery, and so on.
* Type: specifies the menu item type. Each type may require additional fields, as shown below:
- type Home: this menu item points to your main blog page (the latest posts list).
- type FrontPage: this menu item points to your static front page, if configured in WordPress Settings – Reading, otherwise it’s the same as Home.
- type Heading: this menu item is non clickable, and could be used in a multi-level menu as the parent of a set of sub-items.
- type Tag: this menu item points to the tag archive specified in the Tag field.
- type TagList: this menu item generates a menu sub-item for each tag archive, excluding the tags specified in the Exclude field. Please note that, if you add sub-items to a TagList item, they will be ignored and won’t be displayed in your live menu.
- type Category: this menu item points to the category archive specified in the Category field.
- type CategoryTree: this menu item points to the category archive specified in the Category field, and automatically generates a menu sub-item for each sub-category, excluding the categories specified in the Exclude field, and up to the level specified in the Depth field. Any categories selected in the Headings field will be made non clickable. Please note that, if you add sub-items to a CategoryTree item, they will be ignored and won’t be displayed in your live menu.
- type Page: this menu item points to the static page specified in the Page field.
- type PageTree: this menu item points to the static page specified in the Page field, and automatically generates a menu sub-item for each sub-page, excluding the pages specified in the Exclude field, and up to the level specified in the Depth field. Any pages selected in the Headings field will be made non clickable. Please note that, if you add sub-items to a PageTree item, they will be ignored and won’t be displayed in your live menu.
- type Post: this menu item points to the single post page whose post ID is specified in the Post ID field.
- type SearchBox: this menu item displays a search box with an optional submit button whose text is specified in the Button field.
- type External: this menu item points to the static URL specified in the URL field.
- type PHP: this menu item points to the URL returned by the PHP code specified in the PHP code field (see Meta links with Menubar 4.9 for examples).
- type Custom: this menu item is custom built with the HTML specified in the HTML field – for experts only!
For each menu item you can also specify two optional fields:
* CSS class: the optional CSS class you wish to apply to this menu item (useful for customizations, see later); multiple classes can be entered, separated by spaces.
* Attributes: the optional HTML attributes you wish to apply to your menu item (e.g. target=”_blank”, or title=”click me!”); multiple attributes can be entered, separated by spaces.
[back to Contents]
Menubar templates
Menus built with Menubar are styled using Menubar templates.
A Menubar template is a folder inside the wp-content/plugins/menubar-templates folder. Each template folder contains a PHP script named wpm3.php, one or more stylesheets, and possibly a few images.
To install a Menubar template:
a) Download the template archive from the Download page and unzip it;
b) Upload the resulting folder, without renaming it, to wp-content/plugins/menubar-templates.
To apply a Menubar template to one of your Menubar menus:
1) From the Appearance – Menubar administration panel select the menu to be styled, and click Edit Menu;
2) Select the template and the stylesheet to apply, and click Update Menu. Done!
To customize a Menubar template you can edit the CSS rules contained in one of the stylesheets of that template. As already mentioned, you can also apply different CSS classes to individual menu items in order to better control the presentation of your menus.
[back to Contents]
Conclusions
I hope you like Menubar. If you have suggestions for improvement, if you need some help, or if something is not working for you as expected, just write me a comment (please be patient if I can’t answer immediately).
Happy menus, with the WordPress Menubar Plugin!
i’m encountering a small bug – when using IE7, some submenus stay visible even when i hover off them and to the next menu item and the two submenus overlap. Do you know if there’s fix to that?
the site where you can see that bug is http://www.10neegrit.com/diane (when using ie7)
I absolutely love the plugin, but could use some help. How can I position/ align my menu items? Center it perhaps, or maybe move selected items all the way to the right-hand side of the bar? Like for example the ‘Download’ link at http://www.dontdream.it/demo/ I am using suckerfish 45.
Thanks!!
@TCBigPants
You can move a menu item to the right-hand side of the menubar by entering the class name right into the CSS class field for that menu item. But unfortunately there is no way to automatically center a menu item.
@rene
Hi Rene,
please add the visibility property to your CSS:
.sf-blue li:hover,
.sf-blue li.wpmhover {
visibility: inherit;
…
}
That’s a workaround for an IE7 bug, and it’s already added to the current version of the Suckerfish_41 template.
Thank you, Andrea!
hi,
thanks for the great plugin, makes it a lot easier!
Would it be possible to add type: bookmarks (so you could list the bookmarks of the blog?)
Would love that feature!
in any case, thanks again for the plugin!
Hi Jiel,
thank you for your suggestion! I think I’ll be able to add that feature in the next Menubar version.
Do you know of any issues with WordPress 3?
Hi Alex,
there was an issue with 3.0 beta, due to a WordPress bug which has been fixed already. Currently I don’t know of any open issues.
I placed “” right before and i still got this error:
WP Menubar error: Function wpm_display_Superfish() not found!
why?
Hi Leyla,
WordPress ate up your HTML, I’m afraid. Could you please send me an email with details of your problem, or better yet, send me the URL displaying the problem? Thank you!
biotrak.leylamanavi.com
the site isn’t finished. i’m skinning it for a client and i’ve really only skinned the front page so far.
and my previous comment looked like:
i placed “[call to wp_head]” right before the closing head tag and i still got the error.
haha sorry about that.
Hi Leyla,
It looks like your call to wp_head() is not effective. Please double check the syntax, or you could send me your file header.php so I can have a look at it.
I have a project where I need to change the colors of the menu.. there is no green, yello, red options. No problem.
I changed ALL the color references to what I need in the appropriate .css file, and everything works EXCEPT the color of the text. (!!)
After a day of hunting, I still haven’t found what controls the actual texts color…. Where is that set??
thanks a bunch!
I have uploaded the 5 files from the Basic46 into my menubar-templates folder, but wordpress is not recognizing them. Any suggestions?
@Jeremy
Hi Jeremy,
which Menubar template are you using?
@Mary
Hi Mary,
the menubar-templates folder should contain the Basic_46 folder, which in turn should contain the 5 template files.
@andrea
Well, as I continued hunting and pecking I noticed ‘superfish’ does have the green, so I installed that now.
there is a similar question at http://www.blogsweek.com/superfish-questions-answers/comment-page-1/#comment-1228
Ironically on the test setup it is working fine (except the menu font color), but when I transfered to my live site it completely died and is all text now.
all the menu items are there, but something is not hooking right.
it’s on different server (test was hostgator, live is netfirms)
could there be php version problem or something (it’s probably more simple then that I expect)
@andrea
ok … the issue on my live site is that it’s not reading the .css file.
when I ‘edit’ the menu, all the installed templates are populated in the dropdown selector, but there is no visual differance compared to the ‘no .css’ option.
any idea’s?
thanks a bunch
@Jeremy
Hi Jeremy,
please send me a link to your site so I can see the problem. Thank you!
Hi Andrea,
I have the same question as Jeremy had in 1st instant
I have the Superfish red, but i want an other color, orange or prefareble black
How can i change this, and can i change this without loosing all i already done?
Thanks
Emmanuelle
Hi:
Firstly, congratulations on and thanks for a great plugin.
I would be keen to know if it conflicts with breadcrumbs plugins? Because, I tried a couple of breadcrumbs plugin and they don’t throw up any results (no error message either).
Thanking you and hoping for your guidance on the subject,
Best,
Anshuman
Hi Anshuman,
I don’t think Menubar can conflict with other plugins, but you can find that out immediately. Deactivate Menubar, and if the other plugin starts working, that means there is a conflict. In this case, please let me know which plugin is disturbed by Menubar so I can find a remedy. Thank you!
@Emmanuelle
Hi Emmanuelle,
if you wish to change the Superfish colors, you can see the comment #655.
I have a IE – Menubar problem that I hope someone has a suggested solution for. My menu is a fairly straightforward one using Suckerfish, but the drop downs do not work in IE. I have tried a number of suggested Suckerfish fixes, but can’t seem to figure out if this is a Menubar or Suckerfish problem.
The site is http://www.aroundthepitch.com (currently a test site but active)
Here is a link to a zip file containing the stylesheets and header code.
http://bit.ly/9MlDRN
I appreciate any advice that you can give me. Thanks!
Hi Scott,
try using only alphanumeric characters and the underscore in your menu name (e.g. main1 and main_1 are ok, main-1 is not). That’s a Menubar issue already fixed in the latest template versions, perhaps you are using an older template?
@andrea
Thanks Andrea, that did solve one problem I was having in which IE was showing a javascript error. I may be using an older template, I will look into that.
For the drop downs being behind other objects in IE, this ended up being a zindex issue, so I played around with that in the sf-blue.css and got it to somewhat work, but then ran into an issue with both FF, IE and Chrome in which the drop downs were behind the wrapped menu headings. I think this may be theme related, so I gave up on that and decided to just use two menus, the one on top doesn’t use drop downs at all. The one on the bottom has multi-level drop downs that seem to work now. This will be OK for me, and probably results in a cleaner menu.
Thanks for your support of one of the best plugin’s for WP!
I have a problem with the PageTree: I want to display 3 different childs, they have 3 different names. But I think the menubar sorted it out in alphabetical order, and not in the way I want to display the childs. I can not make another arrangement to the childs. What can help here? Sorry, for my English, I hope you understand the problem.
Dear Sirs/Madams,
I hv installed plugin “menubar” from wordpress and activate it.
But nothing happen.
Pls assist to solve this problem.
Would appreciate your prompt reply.
Hendra Subrata Liu
It’s okay. I find a solution. -> Comment #477
@Ursula
Hi Ursula,
I’m sorry, I was out of town and I didn’t see your message, but I’m glad you found a suitable solution!
@Hendra Subrata Liu
Sorry I didn’t see your message before. I noticed that now Menubar displays on your site, so I’m glad you already solved the installation problem.
Hi! andrea!
I have been using the plugin for a week. Recently I changed my theme to wpzoom ” magnific”.
I inserted the code in header.php file that calls the menubar, but shockingly as soon as I added the code , my carousel slideshow stopped working. I removed the menubar code, theme falls back to normal.
Strange problem ! help please
Hi Kanishka,
I don’t own a copy of the theme you are using, could I debug the issue on a test site of yours? Please let me know!
I have the similar problem with the theme, you may find running at ( http://www.bharatbolega(dot)com.
This is a test blog page under construction. The slideshow at the home page , stops working when the menubar is active ..like the parralel slide etc..
once I deactivate the menubar, it falls back to normal.
You can see the site in action.
Hi – I am using the multi-blog option inside of WP3.0.1 and the menubar plugin 2.4.8
My root/home blog is http://www.cinnjack.com/horses
I have lots of sites like …/horses/willow and …/horses/comanche and …/horses/elli – etc. Most of these are only set up, they are not customized or populated yet but they are there.
I have the menubar plugin working successfully on this Blog: http://www.cinnjack.com/horses/elli – I would like to export/use the menu on all my pages (that can be found in the menu list on this page) however, I’m not sure where the files are, the settings, etc.
Is there a way to make this a global menu? That can be called from wherever in my site if I just include the right do_action? If there is, and I have to create it at the root site, how can I export it so that I don’t have to recreate everything?
Basically what I’d like to have on my pages is two menus – the big global one, and one specific to each blog. thanks for your help!
Hi Chelli,
unfortunately there is no way to export/import individual menus from one blog to another, or to access from one blog menus of another blog. Sorry!
How do I create the file “wp-content/plugins/menubar-templates”? I’m using wp-Swift theme.
Hi Nicole,
to create that folder you can use the “File Manager” tool in the control panel of your hosting provider. Just locate the existing “wp-content” folder, then the “plugin” folder inside it. Enter the “plugin” folder and create a new folder named “menubar-templates”.
Hi,
Absolutely great Plugin. Am using it with Suckerfish 41 with sf.blue .css
Am using the following to highlight current page in top-level menu bar.
What would the best way to highlight the current page in a sub-menu ?
.sf-blue li.selected,
.sf-blue li.current-cat,
.sf-blue li.current-cat-parent,
.sf-blue li.current_page_item,
.sf-blue li.current_page_parent,
.sf-blue li.current_page_ancestor {
background: #C82536;
}
Works for main menubar menu. But how to extend this property to a sub-menu ?
Small issue: a menu item of type “heading” can’t be activated on the iPad, since there is no cursor to hover over it, and clicking doesn’t open the submenu.
@Val
Hi Val,
that feature is already part of the standard Suckerfish_41 template, as you can see on the Menubar demo site. Am I missing your point?
@Doug
Hi Doug,
I’m going to look into this issue – thank you for your feedback!
I am using the Aprilia theme and your menubar for Category Trees to display newsletter categories and recipes by type. I am wondering if it is possible to have the Post names displace when there are no further Child Categories?
For instance if “Health” was the final Category in the Category Tree would it be possible to then show a listing of the ~20 Post titles that are related to Health, so that a specific post could be clicked on, rather than seeing a page with all the posts?
Thanks.
Hi Linnette,
it’s not (yet) possible to build that menu structure automatically, but I’m adding your suggestion in my to-do list. Thank you for your feedback!
Thanks for your quick reply.
Beautiful plugin, Andrea. Thank-you for your hard work.
After finding the right template (suckerfish_41 with sf_vertical.css), I didn’t have any trouble getting started or getting things to look just right, but I do have a question still…
How can I make it so the external pages linked in my menus open in a new tab window rather than in the active tab window?
Hi Dan,
you can use the attribute target=”_blank” (put it into the Attributes field).
Thanks for this plug-in. May the next WP will use your menu, who is more precise than the WP 3 menu editor.
Ciao Andrea! Davvero ottimo il tuo menubar! Volevo chiederti una cosa…avrei necessità di realizzare un sito in due lingue (italiano e inglese) e per non realizzare due blog differenti ho pensato di fare così: 1) realizzare tutte le pagine in italiano e in inglese, 2) realizzare due menu, in italiano e in inglese. Ora la necessità è quella di far apparire il sito italiano in primis con un pulsante che rimandi alla “english version”..la english version sarà appunto la versione inglese del menu che linka alle pagine in inglese. Ora…come potrei fare per dire che quando clicco su english version mi deve cambiare il menu in italiano con quello in inglese? Dovrei fare un un if ma nn so da dove partire. Consigli? Grazie mille!