Navigation Menu is a theme feature introduced with Version 3.0. WordPress includes an easy to use mechanism for introducing customised navigation menus into a theme. In order to incorporate menu support into your theme, you need to add a few code segments to your theme files.

learn more… | top users | synonyms (4)

5
votes
1answer
1k views

How to get IDs for objects in menu branch?

Is it possible to print content of all menu items, when displaying menu (or branch of menu as in question about displaying menu branches) ? Once I click on About Us I wish for new page to display ...
5
votes
2answers
393 views

Call custom field into menu item

I have a navigation menu in Wordpress. I would like it to check if the page has a custom field of "menu_icon" and if it does, add that custom field into the menu item it corresponds to. I'm sure this ...
5
votes
1answer
1k views

How to avoid wp_nav_menu() ID conflict?

How do I avoid ID conflicts if I use the same menu TWICE on one page. FIRST wp_nav_menu( array( 'sort_column' => 'menu_order', 'theme_location'=>'menu', 'menu_class'=>'menu', ...
5
votes
4answers
2k views

Making breadcrumb with wp_nav_menu

I was looking for a quick and dirty method to output a breadcrumb navigation on a WP site, without requiring the installation of a plugin and also leveraging the built-in WP menu. Here's what I came ...
5
votes
1answer
468 views

How do I add nested categories to drop-down menu in twenty-eleven?

I know how to do it by writing a separate ul/li css for wp_list_categories, but I find menus of "twenty eleven" already well designed and flexible, so I`d like to use them. Custom menus, when I have ...
5
votes
1answer
701 views

Custom Post Types posts as submenus in Nav Menu

I have created a Custom Post Type called "Collections". I'd like to have in the Nav Menu (no custom menus involved) a menu item 'Collections' that links to the index page of Collections Custom Post ...
5
votes
3answers
725 views

Can I display submenus in groups, using wp_list_pages?

Say I have top-level(parentless) pages called Fruit, Animals, Cars. When, say, Fruit is selected I would like to show links to the individual fruit pages below. I would like to be able to dislpay ...
5
votes
2answers
299 views

Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?

Essentially I'm trying to add multiple sub nav menus and I'm pretty close but I just can't seem to find the right tack to solve my problem ... I'm using a variation of a Stu Nichols CSS Menu ... ...
5
votes
3answers
2k views

Use navigation path from menu for permalink

I now switched to permalinks and defined my own structure /%postname%. If I click on a menu item it takes the path from the parent page (hierarchy defined directly when editing a page). What I want ...
4
votes
2answers
5k views

Adding a Custom Post Type into the menu screen

I need a way of adding custom post types to the "Appearance-->Menus" option in Wordpress. i have created a custom post type with: register_post_type('produksjoner',$args); All examples I find just ...
4
votes
2answers
365 views

Automatically remove trashed pages from nav menu

As it is now, when a page that is in the nav menu is trashed, it still stays in the menu until manually remove via the nav menu editor. Is it possible to have trashed pages removed automatically? ...
4
votes
4answers
4k views

wp_nav_menu: show menu only if one exists, otherwise show nothing

I'm trying to use wp_nav_menu to only display a menu if one exists, otherwise, display nothing. If I delete the menu, it will output a list of the pages. My functions.php file contains: if ...
4
votes
3answers
566 views

How do I add support to my theme for custom menus?

I've read a few tutorials on how to add the functionality of the custom menus added in version 3.0 to my theme but they all seem to differ somewhat, and I'm not sure whether they contain superfluous ...
4
votes
3answers
5k views

Add a .last class to the last <li> in each ul.sub-menu

I've seen a lot of code on how to add a first and last class to a WordPress menu, but in my instance I would like to add a last class to the last li in the sub-menu that WP generates. Here's what I ...
4
votes
5answers
4k views

how to create a menu with all sub categories?

Is it possible to create a menu with a category such that each time that I had a sub category that automatically display on the menu? As far as I know, if I have a menu with the category "fruit", and ...
4
votes
3answers
4k views

non-clickable placeholder in the menu

well, I really would like one & more of my top-level menu items (parent menu items that has child menu items) to be non-clickable, so that visitors can only click on the child menu items...could ...
4
votes
1answer
3k views

Adding category ID or slug to WP Nav Menu

Is it possible to add the id or slug of a category in the output of wp_nav_menu menu's? For example, the standard output of wp_nav_menu is: <div class="menu-header"> <ul ...
4
votes
3answers
7k views

wp_nav_menu remove class and id from li

I'm new to wordpress and trying to learn my way through from making a theme. Right now I am using wp_nav_menu to generate my menu My menu consists of pages and categories However, the default ...
4
votes
1answer
245 views

wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = ...
4
votes
2answers
6k views

Dynamically exclude menu items from wp_nav_menu

I tried looking for info about how to exclude/remove nav menu items from custom menus, and the only thread I found did not have any answers that were useful to me. 1. Background: I put together a ...
4
votes
2answers
196 views

Add Commas Between Menu Items?

I created a menu in wordpress in the Menus section of the backend is there any way to display the menu links with commas so it displays as Link1, Link2, Link3, Link4?
4
votes
1answer
324 views

Remove unusable metaboxes in nav menu management screen

When you visit wp-admin/nav-menus.php and there is no menu you get a set of metaboxes you cannot use. The only thing they do is drawing attention away from the Create Menu dialog. I want to hide ...
4
votes
1answer
755 views

Highlight parent menu item when child is not in menu

I want to highlight the parent of a child page in the menu when the child page itself is not in the menu. I know this would work if you add the child as a sub page but that isn't the case. Any ...
4
votes
1answer
603 views

Attaching a navigation menu to the admin bar?

I have seen a number of solutions of how to manually attach links to the new WP admin bar, but I need to make this much easier for my site admins. It occurred to me that the easiest solution would be ...
4
votes
2answers
761 views

Any official way to create an admin theme?

I was wondering whether there's a common way of customising the aspect of the admin panel. I know you can play with the css and js files but what I was looking for is some kind of "admin theme" like ...
4
votes
1answer
76 views

How can I add (custom) modules to Appearance -> Menus?

Does anyone know how I can add (custom) modules to Appearance -> Menus? (Or has a link with explanation on how to do this) so that when people change their menu in the backend they can choose what to ...
4
votes
2answers
305 views

Menu items (all menus) being deleted randomly on their own [duplicate]

This is really driving me up the wall now. Randomly, all my menu items for all menus are just being deleted on their own. Not the menus themselves but all items within them. This is a custom theme ...
4
votes
2answers
426 views

Highlighting current item of custom post types' sub pages, listed by wp_list_pages

The below code is for listing the custom post types itself and its children in the sidebar. The code works great but does not highlight the sub pages. In functions.php: ...
4
votes
3answers
3k views

wp_nav_menu sort order?

Hey Guys, I'm trying to build a right aligned, wrapping capable wp_nav_menu powered menu. Is there a way to have it rendered backwards, so that float: right; would work and not mess up the order? I ...
4
votes
1answer
294 views

Is there a way to limit the number of top level items in a custom menu?

I wish to implement the wordpress 3 menus API in a client site, but the designs has restraint on the width of the top level menu items. How can I be sure the client won't exceed that limit?
4
votes
1answer
391 views

Show only 2nd level of navigation depending on active navigation

For example, suppose a menu like so: Parent 1 Child A Child B Parent 1 Child C Child D Child E Parent 2 Child F In a certain part of my template, I want something to show depending on ...
4
votes
1answer
1k views

Taxonomy menu with post count and multiple parents

I'm using WordPress 3.1.3 and trying to make a "product" menu with post count in each category. Like this: New Cars (4) BMW (2) Ford (1) Nissan (1) Used Cars (10) BMW (3) Ford (1) Nissan (6) ...
4
votes
4answers
515 views

Any walker causes blank menu?

Using the following, or any other custom Walker_Nav_Menu seems to cause a blank navigation menu, I tried specifying the default to make sure I wasn't going crazy yet it still blanks the output... Any ...
4
votes
1answer
385 views

Nav Menu meta failing to import

I'm the author of the Nav Menu Roles plugin that lets you display/hide menu items based on the user's role. It has come to my attention that the menu item meta does not import when using the regular ...
3
votes
4answers
7k views

How do I remove UL on wp_nav_menu?

I search on this site and found many answers for this question. Most of them is not working on my theme. Here is a one solution I found and it's working according to my need. function ...
3
votes
5answers
8k views

Removing container from wp_nav_menu not working

I'm converting this html menu to wordpress: <ul> <li><a href="/" class="current"><span>Home</span></a></li> <li><a ...
3
votes
1answer
3k views

Menu Items Disappearing

I'm running WP 3.5.1 and I've a menu with about 100 items. When I add new items to the menu older ones disappear. I'm not running Suhosin or similar stuff. What can be the cause? Note: I'm on a ...
3
votes
2answers
7k views

Get the ID of the page a menu item links to?

I am currently using a custom walker to customize the output of wp_nav_menu(), and I am trying to add additional information to the <a> tags. What I want the output for each menu link to look ...
3
votes
2answers
2k views

How to determine if custom menu is active?

My theme registers custom menus with this function: function nav_menus() { if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array('main-menu' => __( 'Main ...
3
votes
2answers
781 views

Show child pages by menu order using Superfish Dropdown menu?

I'm using the superfish dropdown menu to create a drop down menu. It's created the menu fine showing all the parent pages with the child pages in drop down's below. The only problem I have is that ...
3
votes
1answer
3k views

Show a WP 3.0 Custom Menu in an HTML Select with Auto-Navigation?

As part of a theme for a client, I want to be able to show a custom menu (defined via the admin) in a select box that automatically changes pages after changing the selection. Is there a plugin (or a ...
3
votes
1answer
453 views

Walker_Nav_Menu exeption

I'm currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error: ErrorException: Runtime Notice: Declaration of ...
3
votes
1answer
1k views

Using a menu walker add a custom item at the end of the menu's items

I need to add a search field at the end of a menu in a list item. I've been looking at walkers but finding it really hard to figure out what is the last item (or even get the total). Also where would ...
3
votes
3answers
2k views

WordPress built in breadcrumb trail menu?

Looking for a breadcrumb menu that can be called (preferably from a sidebar widget in header.php) that lists... Home > Parent Post/Page > Current Page/Post or alternately... Home > Parent Category ...
3
votes
4answers
5k views

wp_nav_menu() custom container and container_id

So today I started work on my first Wordpress theme and so far it's been a lot of fun. However, I have had difficulty in getting wp_nav_menu() to do what I want. Here's what I want: <nav ...
3
votes
1answer
160 views

How to display wp_nav_menu() conditionally only when not on a 404 page?

I made a custom design for my site. On my header i put my navigation so everytime i call the header the navigation will be called to, so that i would not be calling it all the time. But now i have a ...
3
votes
4answers
15k views

wordpress nav menu using twitter bootstrap

I'm using twitter bootstrap in my theme. I'm trying to use bootstrap menu in my theme. But it use custom attributes like data-toggle. Here is the full code. <ul class="nav"> ...
3
votes
2answers
303 views

Exclude one item from wp_list_pages( $args );

I have a menu that is currently shown with wp_list_pages( 'title_li=' ); This shows all the sub pages from all the pages in the menu. I want to exclude a page with id 56 from displaying its sub ...
3
votes
3answers
1k views

How do I pass an argument to my custom walker?

I've set up a custom walker, and it works as desired when I hard code my variable. What I want is to be able to call my walker and pass it a variable that is used in the walker. For example: ...
3
votes
3answers
7k views

Query menu_order custom post types

I added 'supports' => 'page-attributes' to my custom post type, and now i have the meta box for page ordering. When i use the argument 'sort_column' => 'menu_order' with get_pages() on my ...