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
162 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
314 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
2k 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 ...
3
votes
2answers
925 views

Overwriting Core Wordpress Functions with Plugins

Is there a way to overwrite a core function is the Wordpress core using a plugin? I don't need to inject code, I need to replace the function entirely with a re-written version. The specific function ...
3
votes
2answers
160 views

How does a minimal menu walker look like?

According to the docs of wp_nav_menu we can specify our own walker function. They suggest to copy the default one and modify it as needed. But to be honest, it is a bit too complicated for the to ...
3
votes
2answers
202 views

Remove a menu item in menu

I know this has been asked many times. But from what i got after searching, i could not understand much. I have used wp_update_nav_menu_item to add menu items programatically. But i don't know how to ...
3
votes
1answer
3k views

Add container to nav_menu sub menu

Is there a way I can wrap a div around wp_nav_menu's ul.sub-menu So for example the markup would go from <ul class="menu"> <li><a href="/">Item 1</a></li> ...
3
votes
1answer
1k views

Check if page is in a certain menu

I have a client that wanted two "main menus" and we needed to programmatically display whichever menu contained the current page. How can I do that? Ex: We're on the "About" page. Figure out which of ...
3
votes
1answer
1k views

Dynamically link to the latest post or simulate request of specific post in page template

I want to have a link in the wordpress menu pointing to the latest post of a specific category. Because I am not able put a dynamic URL in the wordpress menu, my approach was to put a page with a ...
3
votes
2answers
999 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 ...
3
votes
2answers
1k views

Use wp_nav_menu() to display a Menu from another site in a Network install?

So I'm basically upgrading an older site and I need to make it multisite as well for some blogs and such. I'd like to have the main site Menu(created from the admin) available on the other sites in ...
3
votes
3answers
10k views

Show specific menu item from wp_nav_menu based on id

I have a wp_nav_menu "Main Menu" such as the following: Top Level (#menu-item-1) Sub Item Sub Item Top Level (#menu-item-2) Sub Item Top Level (#menu-item-3) Sub Item A Sub Item B Sub Item a.1 ...
3
votes
1answer
1k 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 ...
3
votes
1answer
2k views

Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu

I am trying to add some ARIA related stuff to the wp_nav_menu function. I use a custom walker class for this purpose: class Walker_Nav_Menu_With_Aria extends Walker_Nav_Menu { function ...
3
votes
1answer
2k views

Create a formatted table-like menu

I've just put the site up a couple weeks ago and adding some more things to it for my friend however there's got to be an easier way to lay content out over wordpress. I've having a hard time with it ...
3
votes
1answer
2k views

Add a custom walkter to a menu created in a widget

I know how to add a Walker to a custom menu created by the theme (menu named primary in this example), but how can I target a menu thats created in a widget with the default wordpress custom menu ...
3
votes
2answers
1k views

Unregister Nav Menu from Child-Theme

I like to use the Starkers Theme and build child-theme. So, I`d like to remove the this primary menu Starkers (functions.php) function starkers_setup() { // This theme uses wp_nav_menu() in one ...
3
votes
1answer
438 views

How to apply a class to the second word in menu list item?

I want to apply a class to a word in my menu. For example, say I have a list item in my menu called "My Item". I would like to apply a class to the word "Item" so that I can style it anyway I want. ...
3
votes
3answers
4k views

How to count nav menu items?

I'm creating a custom walker for my nav menu. The goal is to split the menu in to columns like so: I can easily determine where I am in the list by looking at $item->menu_order. What I don't ...
3
votes
4answers
4k views

remove last separator?

using; $args = array( 'menu' => 'mainmenu', 'container' => 'ul', 'menu_class' => 'span-10 clearfix', 'after'=>'/'); wp_nav_menu($args); which gives me; london/munich/artists/fairs & ...
3
votes
2answers
2k 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
2answers
402 views

How to highlight the right item in the navbar

In my site i have a navbar which is created by using the new feature of wordpress 3 - "the menus ".In my site this navbar conatins both categories and pages. When I'm in a single post / sub-page , ...
3
votes
3answers
6k views

Menu limit, cannot add new menu items

I'm running WP 3.4.2 on a VPS. When I first moved to this VPS server and imported all my WP data from the old, the menus worked fine. However, for some reason, I cannot edit/add to the menus, and some ...
3
votes
1answer
358 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
3answers
1k views

One site, 2 distinct sections: two different top nav menus?

I have a site that is in two distinct halves. I'd like the same template to apply to the whole site (from a look & feel perspective), but for each 'half' of the site to have its own top nav menu. ...
3
votes
1answer
3k views

Why is my menu order not working with wp_nav_menu?

I have a custom menu using the new Menu System but it is not returning in the correct order. I have no idea what order its in - its not alphabetical, or by date, or by any pattern I can see. The link ...
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
3k 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
42 views

Walker class: Problems with understanding how walk() method can be called without error

I am struggling with understanding how WordPress uses the Walker class. In particular, I don't understand the walk() method (I think). First, let me explain what I understood: When calling ...
3
votes
1answer
253 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
2k 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
2answers
939 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
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
3k 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
1k 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
3answers
8k 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
771 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
2answers
126 views

Adding Post Counts to Menu (Nav) Programmatically?

I'm fairly stumped on this. Without getting too query-heavy, I was wondering what path one might take to produce a menu that links to a category of posts, and displays in parenthesis how many new ...
3
votes
1answer
773 views

Keeping parent menu items active in child pages

I'm a begginer in php and css. I would like to know how to keep an top-menu item underlined while navigating on child pages. Here is my layout: I have a navigation menu, listing all my parent pages ...
3
votes
1answer
346 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
182 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
144 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
228 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
2k 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
300 views

Creating new dynamic menu including BP links [closed]

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
270 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
316 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
475 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) { ...