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)

3
votes
1answer
1k views

Can you have different menus and theme on a per-page basis?

I am planning to have a new site created using WP pages. My company is focusing on 3 or 4 discrete areas and one of those I want to promote in particular, with its own set of pages. Ideally it would ...
3
votes
1answer
2k views

Whats the difference between current_page_item and current-menu-item

Whats the difference between current_page_item and current-menu-item when using Custom Menus .current_page_item{} // Class for Current Page .current-cat{} // Class for Current Category ...
3
votes
1answer
218 views

Determine which theme location a wp_get_nav_menu_items is for

Is there a way to determine which theme placement a menu is for when modifying it with the wp_get_nav_menu_items filter hook? I'd like to only add items to certain menus and I don't want to have to ...
3
votes
1answer
702 views

Wordpress Export Import Site Navigation Menu

When I do an export and import the menus get transferred but I have to set the Site Navigation Menu manualy. Obviously it's only a small detail but can I ask is this a bug or expected behaviour and is ...
3
votes
1answer
218 views

How is custom menu hierarchy output handled?

I'm looking to pass custom nav_menus through an RSS feed so I can grab them on other sites to create the same custom menu on multiple sites. What I can't figure out by looking through the database is ...
3
votes
2answers
795 views

Custom metabox for menu administration page?

I've been googleing around but failed to find a solution for my need. I'm using wordpress 3.0 and TwentyEleven theme as default pack. In the Dashboard -> appearance->menus that allow user can ...
3
votes
3answers
2k views

Nav menu separators?

Anyone know of a plugin that can, or have an idea how to, allow a user to drop in separators/dividers between certain nav menu items? Google only seems to bring up rookie CSS tips for first/last ...
3
votes
4answers
2k views

How to add current, parent, and ancestor menu item IDs to body_class()?

(just got reccommended to post this over here from stack overflow...) I am just starting with Wordpress (defecting from Joomla)- having a bit of difficulty getting started. One thing I am trying to ...
3
votes
1answer
2k views

wp_nav_menu() customized

<div class="example"> <h1>Menu</h1> <ul> <li>sub-menu</li> <li>sub-menu</li> <li>sub-menu</li> </ul> </div><!-- ...
3
votes
1answer
879 views

How can I get my Custom Post Types to appear in nav-menus.php 'Menu'?

I am having a bit of a problem with my custom post types. I can create them fine in my theme, but I cannot get them to show up in the 'Menu' screen ... at least not by default. I have tried adding ...
3
votes
2answers
1k views

Allow html tags in WordPress Custom Menus Description Field

I added descriptions to my menus using this post, Menu items description?. However I need to be able to use html tags and WordPress is stripping them out. Can anyone help?
3
votes
3answers
7k views

Using Image Links in Wordpress Navigation Menus Instead Of Text Links

Does wordpress support the capability to use images in the navigation menus instead of text links? I searched for this capability and found a site that shows how to include images in the menu through ...
3
votes
1answer
746 views

How to Programically add to the new WordPress menus

Pre WordPress 3.x I was using: add_action( 'init', 'product_register' ); add_filter( 'wp_page_menu', 'custom_page_nav', 90 ); function product_register() { // register_post_type( 'product', ...
3
votes
1answer
233 views

Make Theme automatically choose default nav menu

I have been developing a WordPress theme. I want to be able to, once activated, look to see if there is already a menu created in the backend. If it exists then choose it and use as the primary menu, ...
3
votes
1answer
98 views

How can i change menu link when page content empty?

I have a menu with parent and child. I created menu from admin panel using Appearance >> Menus with selecting page. But some of my parent pages content empty so i want to set link(null) when page ...
3
votes
2answers
138 views

Move admin menu at the end

I installed a plugin for my users in WPMU and I want to make it appear at the end of the admin menu .... I tried this but the menu never appears at the end: function custom_menu_order($menu_ord) { ...
3
votes
1answer
172 views

Customize the menu by adding items

I need to display a simple menu like this: <nav class="main"> <a href="/" class="home"> <span class="logo"></span> <span class="company-name">My ...
3
votes
1answer
959 views

Determine if a navigation item has children

I am trying to determine if an item has a sub-item with depth 1 or higher. I cannot find anywhere if there is some function/query I can write that grabs the current item looks in the database if it ...
3
votes
1answer
213 views

Creating new dynamic menu including BP links

Perhaps I have missed something fundamental, but I am attempting to include the various dynamic menu items included with BuddyPress and other add-ons to my primary drop-down menu. For example, the ...
3
votes
2answers
200 views

Taxonomy slug by term ID

I'm trying to modify wp_nav_menu to display term thumbnails. To get those thumbnails I need term ID and taxonomy slug: $thumbnailimg = get_the_term_thumbnail($term_id, '$taxonomy', 'medium'); I ...
3
votes
1answer
306 views

How to implement separate sub-menus?

I want to implement two menus that work like this: Cars *Animals <-selected Recipes -- Bear *Dog <-selected Cat So the top menu in the main menu, the the menu below is the ...
3
votes
1answer
411 views

Extend walker class with custom post types [closed]

I'm using the walker class below, but I can't make it work with custom posts. class Zwp_Walker_Nav_Menu_Dynamic extends Walker_Nav_Menu { function end_el(&$output, $item, $depth) { ...
3
votes
1answer
233 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 ... ...
3
votes
1answer
295 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 ...
3
votes
1answer
398 views

How do I create a magazine type menu - sub-menu setup using wp_nav_menu and child of twentyten? [closed]

I'm trying to create a menu and submenu with a child theme of twentyten, similar to this at the LA Times: http://www.latimes.com/ where when the site is first opened, it displays a set of childs, and ...
3
votes
2answers
4k views

Navigation menu with children shown only for current page

I've been playing around with Wordpress' menu functionality (wp_nav_menu and wp_list_pages) to build a menu for my site. It's coming along, but I'm still having some trouble getting the behaviour I'd ...
3
votes
6answers
3k views

Large WP 3.0 menu times out and won't save

I have a large menu containing 10 parent items with roughly 7 child items each that I am trying to build using the WP-admin > Appearance > Menus. I have nearly all the menu items added but now my ...
2
votes
4answers
3k views

Adding a class (arrows) to main menu links that have children?

I'm wondering if it is possible to add different classes to second/third/fourth/etc-level items that have children in Appearance > Menus tree? That's how I call the menu: <?php $menu_args = ...
2
votes
5answers
7k 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 ...
2
votes
2answers
1k 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 ...
2
votes
2answers
6k 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 ...
2
votes
2answers
362 views

Adding line breaks to nav menu items

I need to add line breaks to the nav menu item titles. I didn't realize this was a problem as when I am logged in as a Super Admin, I can add <br/> just fine, but apparently regular-level ...
2
votes
1answer
930 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 ...
2
votes
2answers
2k views

wp_nav_menu doesn't generate parent/ancestor classes

I don't know why the proper classes for menu item are not generated - all the elements in the tree which has subtree get only menu-item menu-item-type-post_type. The elements, which don't have ...
2
votes
2answers
630 views

Building a Sub-menu: Display Parent Category/Page's Children When Viewing Children

I would like a sub-menu in which the user visits a page, post, or category (in this example, "info") and is then displayed a list of children categories/pages. Not a dropdown menu, but a menu that ...
2
votes
1answer
284 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 ...
2
votes
1answer
92 views

Menu items id's - are they 100% unique?

With regards the menu item id's WP generates such as menu-item-814, are these 100% unique in nature? I know they are unique at the time, but are they always unique? Meaning that if I was to delete ...
2
votes
1answer
939 views

How to var_dump nav menu items from anywhere?

I wanna preview all the fields that the nav menu $item array holds. Is there a function to fetch it from anywhere and place it inside var_dump?
2
votes
2answers
1k views

wp_nav_menu log in/out link?

I have a wp_nav_menu showing pages, but I'd also like to include a log in/out link, based on the current state of the user, which will redirect them to the home page. I've looked far and wide, but ...
2
votes
1answer
544 views

Custom wp_nav_menu output (displaying all child elements of top menu element in current branch)

I would like to create a walker function, or modify somehow current wp_nav_menus so it can produce a custom output. Let's imagine this structure: menu item 1 menu item 2 submenu item a submenu item ...
2
votes
1answer
2k 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 ...
2
votes
2answers
416 views

Exclude Private, Draft pages from Primary Nav when using custom menu

I'm looking for ways to prevent "private" and "draft" pages from appearing (to non-logged-in admins) in a site's Primary Navigation menu which is based on a custom menu - other than manually removing ...
2
votes
2answers
187 views

How do I make a wordpress plugin with menu item etc

I've been reading documents, viewing videos, etc. on how to create a Wordpress plugin. I've learned how to filter a post, add txt to a post, use conditionals to see if the page is a single post as not ...
2
votes
1answer
1k views

How to use logout function on custom menu link?

All I am using wordpress custom menu, and there is one menu as Logout. I know wordpress Logout function <?php echo wp_logout_url(); ?> But how can i use it in custom menu ?
2
votes
2answers
695 views

Is it possible to add classes to list items in wp_nav_menu()?

I am using <?php wp_nav_menu( array( 'theme_location' => 'header-menu', 'menu_class' => 'nav-bar', 'container' => 'nav' ) ); ?> to output my ...
2
votes
2answers
972 views

add_action for saving a custom menu

Say you have custom menus enabled with your WP theme. Is there any action associated with saving a menu once you've arranged it accordingly? To further clarify: say you've arranged a menu with some ...
2
votes
3answers
311 views

How do I add a post to a menu

I'm trying to get WordPress to highlight a specific item in my menu when a post (any post) is viewed. I'm thinking that adding the post to the menu item, then suppressing display of sub-menus might ...
2
votes
1answer
67 views

How to highlight the current page in the nav menu?

I'm customizing a WordPress theme for my school, and I'm a bit annoyed by the fact that the current page in the nav menu is not indicated. For example: You can clearly see that I'm hovering over a ...
2
votes
2answers
57 views

How to gain access to each menu item in wordpress?

I have some menu items in a menu at location "main-menu". By using wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); , i get all the 13 items in a div. Now i just need to show 10 menu ...
2
votes
2answers
4k views

How to use a WordPress' existing admin icon?

I use the add_menu_page function to add an new admin menu: add_menu_page( 'Custom_menu', 'Custom_menu', 'edit_posts', 'custom_slug', '', 'wordpress_existing_icon', 5 ); ...