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!
Hello Max,
To get a dropdown menu, make sure you are using a multilevel template like Suckerfish or Superfish.
Hello Andrea this is working well. I do have one question: I tried to change the select menu on the css im using to look like the below link. I just need the selected to have a different font. please here are the links:
sample menu to look like:
http://shymagazine.com/menu.css.png
Suckerfish downloaded:
http://shymagazine.com/sf-grey.css
please help, i spend 3 hours and cant do it
Thanks
Hello Max,
You could try modifying the rule
.sf-grey li.selected,.sf-grey li.current-cat,
.sf-grey li.current-cat-parent,
.sf-grey li.current_page_item,
.sf-grey li.current_page_parent,
.sf-grey li.current_page_ancestor {
background: #808080;
}
Hello Andrea,
I tried it and just cant get it right. I just need the the rule to have the text selected to be different colors like http://shymagazine.com/menu.css.png
Please can you help me by adding the rule for me? Im not that great with this im better as a designer.
Thanks Andrea
oops sorry http://shymagazine.com/sf-grey.css
Hi Max,
I spent some time with that CSS but I’m not able to get the result you are looking for. Unfortunately Suckerfish is a complex CSS, I’m not the original author and I’m not a CSS expert either, so I had to give up. Sorry!
I get a message as you told:
WP Menubar error: Function wpm_display_Suckerfish() not found!
But how do I make a call to wp_head() in header.php?
(I am using the twenty ten theme)
Thanks, Ineke
Hi Ineke,
The Twenty Ten theme already has the call to wp_head() in its header, so the problem is different this time. I could help if I could see your site, please let me know your URL.
Hi Andrea,
This plug-in looks awesome. Exactly what I’ve been looking for. But can you tell me if I can customize it to look the same as the graphic I’m currently using for my menu (http://www.discdish.com) ?
Silly question, but I’m not a programmer, and the customization I’ve done on this site has taken a while to learn. So every change I make is something new I have to learn, and from your FAQ, I wasn’t sure if it could be done.
Thanks in advance for your help.
Hi Sam,
Yes, you can start from a Superfish Menubar template and modify its CSS according to your needs. Be careful to make one change at a time, and test that change in all the browsers you wish to support, before proceeding to the next change.
Ok, Thanks, Andrea. I’ll give it a try.
Hi, I was tring to make a website though I dont have any knowledge about scripting. I tried to make a customized manu using Manubar. I followed the instruction as it is said above. I end up with two menubar. I spended couple of hours, but couldnt fix it. Now I think I have to delete the manubar that comes with default template. Because if I create any manu that popups underneath the original menubar. Please anyone can tell me how to fix this problem.
I am using iNove theme & Here is my website. http://hornshell.com/wordpress/ you can check what is the problem. Please let me know if you have any idea.
Hi Kamal,
Please follow these instructions:
http://www.blogsweek.com/menubar-with-the-inove-theme/
for the correct installation of Menubar in the iNove theme.
@andrea
Andrea, thanks for your feedback. its working now.
I am using the Menubar plugin with the Suckerfish template. I pretty much have all colours and everyone customised to my liking except for one thing.
This is the site I am working on at the moment http://anagastonnetballclub.com.au/
- When you click on News in the menubar, it gets highlighted to dark blue (good).
- When you click to go to one of the individual posts, e.g. Site Under Construction, the News in the menubar is no longer highlighted, so it looks like you’re not on any particular page (not good).
Would you be able to help me Andrea?
@Thanh Ngoc
Sorry, the website is actually http://angastonnetballclub.com.au/
Hey Andrea,
This is an AWESOME menu plug-in. I love love love it!
I’ve got it working on my site (http://www.discdish.com), but I was wondering if you could tell me how to change the background so it’s a graphic.
Our menu design used to use a graphic that matched the headers of the widgets in our sidebar. The graphic runs the width of the top nav menu with the menu words on top. I’d like to still use the same graphic and just have the dropdown a matching color. Is that possible? I tried putting the graphic in for the background in the CSS but I couldn’t get it to work, it would just make the menu run with no structure at all, just text links one after the next vertically.
Thanks for your help, and a HUGE THANKS for this plug-in. This should be recommended to all WordPress users. It’s so easy to use and so powerful as far as giving you more options for your menus.
@Thanh Ngoc
Is the ‘News’ menu item a ‘Category’ or ‘CategoryTree’ type? If so, it should work as you expect. If not, try changing its type to ‘Category’ or ‘CategoryTree’. Please let me know!
How do you set the attributes so that images show in Internet Explorer? They show in Firefox.
Sample of what I inserted is: <img src="http://conservativepartyusa.org/images/Buttons/Contribute_flag2.jpg" width="160" height="37"
@andrea
Hi Andrea. I’ve made the News page an actual static page (using page templates) because I want the url link to be http://angastonnetballclub.com.au/news not http://angastonnetballclub.com.au/category/news. I didn’t want the word ‘category’ to be in the url. If I choose ‘Category’ like you say and News as the category, it works (which is good), but it puts the word category in the url.
I was wondering if there was some kind of work around for that, or if I’m stuck with using category in the url. Thanks for your help Andrea, I really appreciate it
@Thanh Ngoc
To remove ‘category’ from the category URL, you could try using ‘WP No Category Base’:
http://wordpress.org/extend/plugins/wp-no-category-base/
@Sam Gallo
Hi Sam,
Try adding something like ‘><img … ‘ instead of ‘<img … >’ (note the difference in the angle brackets).
Moderator:
That worked. One last error. And it may just be a URL address problem. This only effects the bottom menu item. the URL is: https://secure.piryx.com/donate/MzrtGHXE/ConservativeParty/
It goes in FF, but in IE, it only displays the header of the target website. I’m going to ask Piryx for an answer. May just be a better address.
Sam Gallo, did you use that img coding in the background part of the CSS?
I think we have similar problems, although I can’t get my image to show up even in Mozilla. I’m new to coding, so something’s obviously going over my head.
Thanks very much.
@Sam Gallo
Yes, I think that’s a page problem.
@Sam
Hi Sam,
Sam Gallo was adding images to individual menu items, while you need a menu background image. I’m still looking for a solution, I’ll let you know if I find one.
@andrea
Thanks Andrea! That’s exactly what I was looking for.
Just one more question (sorry!). For a different website I am working on, I would like to change the text colour of the current menu item that is being highlighted and I am not sure how to do this. At the moment, this is the css where I think I should be able to change the colour.
.sf-vertical li.selected,
.sf-vertical li.current-cat,
.sf-vertical li.current-cat-parent,
.sf-vertical li.current_page_item,
.sf-vertical li.current_page_parent,
.sf-vertical li.current_page_ancestor {
background: #ccc;
}
If I add color: #000; to this css nothing changes, so I think I am adding it to the wrong spot?
@Thanh Ngoc
Probably you have to add an ‘a’ to the end of each selector, like this:
.sf-vertical li.selected a,...
{
color: #000;
}
Thanks, Andrea. I’ll keep an eye out.
@andrea
Great! Thank you Andrea for all your help.
@andrea
After trying the plugin WP No Category Base, unfortunately it wrecks the pagination of my customised categories
Hi Andrea
I love the menubar multilevel options… and this may be a dumb question…
It’s seems a lot of work to set up!
My web guy installed it so it’s up and running, but now I am adding posts, cats and tags to my WP site it’s like it’s double the work of using the ‘standard’ WP posts / cats ‘tree’.
Each time I create new categories I have to set all the nav bar parameters in such detail and on a page seperate to the posts / cats page.
I get that this is the advantage as well…but I am laying out my site structure for SEO (with a few draft posts for now which I will fill in) and I’m going back and forth between two pages doing 2 or 3 times the work.
Did I miss something in efficient use of this great tool or is this just the way it is?
Thanks
Mo
Hi menu bar is a wonderfull plugin, first of all thanks for that.
My problem is that I created a new template.php and when im using it i get the error message
“WP Menubar error: Function wpm_display_Suckerfish_41() not found!”
I tried to copy the foler Suckerfish_41 and putted it in the same folder of my Template.php but i still get the same error message and cant get the menu to display. Any tip on how to overcome this error??
Thanks.
@Mo
Hi Mo,
Probably you are using the ‘Category’ menu item type, and that means you have to add every single category to your menu. If you use the ‘CategoryTree’ type instead, each new category will be added automatically to your menu. That’s not true if you wish to add categories to the first menu level, in that case you have to add them manually.
@Hugo
Hi Hugo,
The best way to make a new template is to modify an existing one, without changing its name, so you won’t need to create new files and folders.
@Thanh Ngoc
You could try a different one, e.g. http://wordpress.org/extend/plugins/tentblogger-seo-categories/
Thank you so much Andrea for this wonderful plug-in. Hello from Western Canada, it really works well
. Please add me to your mailing list. Best regards.
Thank you Karen!
Hey Andrea – thank you
I had Menubar 4.10 installed by a web design company on this site…
http://www.supereasyav.com/
If you take a look you’ll see I have ‘ghosting’ of the second level menu.
The guys who installed it tell me Menubar is not stable past the first level, but it seems you have plenty of people here who use multilevel menus without a problem.
Is there an issue? And if so is there a fix?
Also, is there a simple way to reduce the font size in the Menubar?
This tech stuff is not my strength and so I have to get someone else to do it for me.
Thanks in advance….
Hello Mo,
You are using Menubar with the Superfish template, but the original CSS has been modified, causing problems with the second menu level. Please have a look at the demo site http://www.dontdream.it/demo/ to see the original style and verify that the second menu level is working fine.
To solve your issues you can use one of the original styles, see the demo site, or you can ask a CSS expert to modify the original Superfish CSS. Unfortunately I can’t help you on this, because I’m not the original Superfish author, and I’m not a CSS expert either. Sorry!
I am using menubar 4.1 and superfish template, with a drop down menu of 11 horizontal items, each with their own child sub-menus. I want the name shown in the 11 section hoizontal menubar and its child menus to be a shortened version of the page tile. Eg in the menue bar it could be lions but the page title to which it refers is lion -buffalo interaction at Duba Plains Botswana. That is can the menu name be different than the page name it refers to?
Hi Les,
Yes, the menu name can be different from the page name it refers to, unless you are using a menu item type of CategoryTree, PageTree or TagList, where you can’t change the names of the child items.
To change the menu name in all the other cases, use the ‘Name’ field in the menu item edit page.
Great plugin, but how do I change the order of my drop down items?
Hi Matt,
If you are using a PageTree or CategoryTree item type, you can’t change the order of their drop down items. To avoid this limitation you could build your menu using all the other item types.
@Mark P
The site is http://www.tfana.org. A quick patch would be great… thanks so much
Andrea,
have just installed Menubar , followed instructions which are clear enough but i can get the menu to display, I get WP Menubar error: Function wpm_display_Basic_46() not found!.
ive checked all the code and it seems to be ok. uploaded the templates and configured them ok. Can you help thanks
Wayne
sample code:header.php
<body >
Hi Wayne,
I need a link to your site so I can have a look. Please let me know!
Hi Andrea,
I am using the menubar 4.10 and I have installed the Basic_46 template. i am also getting the same error ” WP Menubar error: Function wpm_display_Basic_46() not found!.”
Could you please help me. My site name : movieballet.com
Hi Reddy,
At the moment Menubar is not active on your site, so I can’t look for what’s possibly wrong. Please reactivate it and let me know when you are ready!
@andrea
andrea,
thanks for the reply, I’ve sorted it ! the problem was with my testing server and cs5 discovering related files ?
installed on live site and is working fine
Great plugin , can i donate ?
Wayne