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)

48
votes
3answers
54k views

Menu items description? Custom Walker for wp_nav_menu()

Normal Wordpress Menu looks like: Home | Blog | About us | Contact But I've seen many pages with descriptions under these links: Home Page | Our Blogs | About us | ...
59
votes
11answers
25k views

Display a portion/ branch of the menu tree using wp_nav_menu()

I have a menu defined in WP Admin that looks like this: I want to be able to display all the child links on the sidebar whenever I am at a parent page. For example, if the user is on my "About Us" ...
2
votes
1answer
2k 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 ?
0
votes
1answer
791 views

Add log in link to menu in Twenty Twelve

I can't find a way to add the log in link to the new theme of WordPress, Twenty Twelve. I did find a lot of answers on the older theme, where they suggest to add some code in the functions.php file. ...
16
votes
6answers
15k views

Changing the Order of Admin Menu Sections?

I am getting a bit frustrated over here after having spent a few hours trying to accomplish this fairly simple task without any luck. Essentially I have 5 custom post types which I created and all I ...
16
votes
2answers
6k views

Adding an Arbitrary Link to the Admin Menu?

Is there a way to add a arbitrary hyperlink to the WordPress admin menu (I mean the menu on the left when you log into the admin dashboard)? For example, can one add a link to Google? In my ...
15
votes
4answers
12k views

How to Hard Code Custom menu items

Is there any way that i can hard code the custom menu items when first theme installed? I am creating a theme which will automatically make some common pages when installed. So I need to know if I can ...
23
votes
2answers
12k views

How to add a custom field in the advanced menu properties?

Is it possible to add a custom field to menu items? What I want to do is be able to add a field for 'French Navigation Label' and a 'French Title Attribute' in the wp menu interface.
20
votes
2answers
20k views

Any docs for wp_nav_menu's “items_wrap” argument?

I'm using wp_nav_menu and am trying to create custom output for the sub-level drop downs. I came across the "items_wrap" argument but there's really not much information as to what it is, how it ...
2
votes
1answer
1k 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?
1
vote
1answer
2k views

Category menu item and its last 10 posts as sub-menu

i have some posts categories as element of a main navigation menu, and i'd like to display the ten lasts posts of this category as sub menu. ex: Category1 Lastpost1 Lastpost2 The ...
17
votes
7answers
23k views

Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?

(Moderators note: Was originally titled "wp_nav_menu Ancestor class without children in navigation structure") I have a wp_nav_menu in my header which had three pages in it. When I am on one of those ...
15
votes
2answers
21k views

How to use wp_nav_menu to create a select menu dropdown?

I'm using the following inside the wp_nav_menu function to create a select dropdown menu where each menu item is an option in the select dropdown... 'items_wrap' => ...
15
votes
4answers
10k views

Add 'has_children' class to parent li when modifying Walker_Nav_Menu

I'm writing a customised walker class for wp_nav_menu and want to be able to specify if an li contains a submenu. So I want my markup to be: <li class="has_children [other-wordpress-classes]"> ...
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 ...
4
votes
1answer
304 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 = ...
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
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 ...
1
vote
2answers
297 views

How to activate “Description” metabox for menu item programmatically?

I'm creating custom wordpress theme. How can I enable "Description" metabox for menu items (on nav-menu page) by default programmatically?
0
votes
1answer
896 views

How to Use the Function is_user_logged_in To Display Different Menus?

So, I want to create different menus for people who are logged in or not. I got a reply that i should use a function if (is_user_logged_in()) { wp_name_menu(array('theme_location' => ...
-1
votes
1answer
490 views

WordPress wp_nav_menu within iFrame

EDIT 2: How would I iFrame wp_nav_menu contents while maintaining the styles and script associated with their display? (Please ignore all of the below seemingly confusing context of why someone would ...
0
votes
1answer
110 views

Menu is not visible in appearance

I have added following code to my function.php function register_my_menu() { register_nav_menu('header-menu',__( 'Menu' )); } add_action( 'init', 'register_my_menu' ); And here is my code where ...
21
votes
2answers
16k views

Customizing Only a Specific Menu using the “wp_nav_menu_items” Hook?

Thanks to some help on here, I've managed to add a custom search box to my main menu... by adding this to my theme's functions.php add_filter('wp_nav_menu_items','search_box_function'); function ...
17
votes
3answers
10k views

Programmatically add a Navigation menu and menu items

Through API functions, I want to define a new Navigation menu, select it in the current theme, and then insert a few Pages as menu items. This is to be done for instance on a theme activation. ...
6
votes
2answers
2k views

How to add a custom metabox to the Menu Management admin screen?

Although I am very thankful to the wordpress core team that they have finally integrated native menu management capabilities I get frustrated with some key elements which I would like to change. I ...
2
votes
4answers
4k 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 = ...
4
votes
2answers
7k 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 ...
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 ...
0
votes
1answer
12k views

Creating Multiple Menus when using the TwentyTen Theme?

How to get multiple menus in TwentyTen theme?
2
votes
2answers
288 views

How can I access the “description” of a menu item?

Where you can add your menu in under appearance > menus, I have descriptions in. In my page, I want to be able to echo out that description. Not in the menu, but in my page. How can I access this ...
10
votes
9answers
5k views

Adding first / last CSS classes to menus

is that possible, without javascript hacks? like this: <ul class="my_menu"> <li class="first"> ... </li> <li> ... </li> <li> ... </li> <li ...
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 ...
5
votes
4answers
13k views

How to get current-menu-item title as variable?

Is possible to get current-menu-item as a php variable? I'm listing the category museums via the menu item 'museums we support' so i'd like the get 'museums we support' bit and display it somewhere? ...
2
votes
1answer
5k views

Bootstrap drop down menu with wp_nav_menu

I am trying to build a Wordpress theme with boostrap, but the nav menu is giving me some trouble. I would like the dropdown to work like boostraps dropdown, but I do not know how to do this. This is ...
2
votes
1answer
4k views

Wordpress default menu in database

There are 3 menus in my wordpress(3.5) now. Main menu (default from wp) Footer menu (default from wp) Test menu Now I have kept test menu as default. Where does Wordpress store this thing? I ...
1
vote
2answers
767 views

How to Move the Author Metabox into the “Publish” metabox?

About a year ago I remember seeing a plugin or some code which allowed you to add an author dropdown menu to the post "publishing" metabox instead of it being on its own. I can't seem to find this ...
5
votes
2answers
2k views

Custom Post Type Menus

I'm writing a plugin for work because our main website is being ported to WordPress eventually. I've got multiple custom post types planned for this plugin and would like to group them all into one ...
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
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 ...
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 ...
1
vote
1answer
2k views

WordPress Settings API, Implementing Tabs On Custom Menu Page

I've been following the WordPress Settings API tutorial series of this guy: http://wp.tutsplus.com/tutorials/theme-development/the-complete-guide-to-the-wordpress-settings-api-part-1/ So far, I've ...
20
votes
2answers
8k views

add_menu_page() with different name for first submenu item

The add_menu_page documentation says to pass the menu title as the second parameter: add_menu_page('Page Title', 'Menu Title', ...); When adding more pages later via add_submenu_page, the main page ...
2
votes
2answers
6k 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 ); ...
1
vote
2answers
544 views

Get menu links only

I'm creating a template in HTML5. On navigatiom menu i need to implement something like this <nav> <a href="url1">url1</a> <a href="url1">url2</a> <a ...
1
vote
3answers
2k views

How to add meta box to backend menu page

I need to add a meta box to the backend menu page, in Appearance->Menus (/wp-admin/nav-menus.php), to list all the available post types, both the defaults & the custom ones. It will contain a ...
1
vote
2answers
4k views

wordpress custom walker for thumbnails with custom menu

I'm still very novice at PHP so any help is greatly appreciated. Typically I have found the codex to be very helpful but it appears custom walkers may be outside its scope. I'd like to have ...
1
vote
2answers
965 views

Minor css-change based on topmenu - how?

I want to make minor css-changes based on the choice of the top (root) menu. What's the proper way to handle this in WP? //edit// It's a website (pages), no blog, and basically, the colors of some ...
0
votes
1answer
3k views

Add custom attributes to menu items without plugin

I'm trying to figure out the best way to add custom menu attributes without using a plugin. I have a site using a custom theme and need to make sure this is setup at theme activation vs needing to ...
0
votes
1answer
2k views

How to style a specific nav menu item?

I have a site, which now have a new registration form and I want to highlight it by blinking the menu item. you can see the site here. I wan to blink "Registration for seminar" item. I am using ...
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. ...