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)

1
vote
1answer
212 views

Can I add pages to my custom menu via script?

My theme has a custom menu assignment... function my_register_my_menus() { register_nav_menus( array('header-menu' => __( 'Custom Header Menu' ) ) ); } ...and I'm creating an "installer" ...
0
votes
0answers
41 views

Post label “new!” in wp_nav_menu using class?

I'm looking for a function to add a "new" label in front of my custom post type name in my navigation menu. The code is : <?php $args = array( 'numberposts' => '1' ); $recent_post = ...
0
votes
2answers
601 views

Remove navigation from header in custom page template

I'm building a landing page and want to remove the navigation menu from the page. The navigation menu is in header.php which is of course in the page template. Is there a WordPress function I can use ...
0
votes
2answers
1k views

wp_nav_menu not appearing correctly on category page

this is the code i am using to call wp_nav_menu <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => '', ...
0
votes
1answer
126 views

Why isn't the Settings API designed to work for plugins using custom admin menus? [duplicate]

Possible Duplicate: How should one implement add_settings_error on custom menu pages? The Settings API offers all sorts of labour saving features and future proof code. I find it really odd ...
5
votes
2answers
1k views

How can I create an auto-populated menu that is automatically assigned to a location?

I'm trying to add BuddyPress nav menu support to my theme and, unfortunately, BP's template tags still aren't fully up to snuff. (Basically, if you're not making an explicit child theme for the BP ...
9
votes
2answers
9k views

Generate a Menu that Displays Child Pages using wp_list_pages() with the New Menu Functionality in WordPress 3.0?

Previously, I was able to selectively load child pages for a currently-selected parent page using logic such as: if( $post->post_parent ) { $children = ...
3
votes
1answer
287 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
4answers
14k 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"> ...
7
votes
2answers
5k views

Display Menu Name using wp_nav_menu

I have a custom menu that I can call just fine using wp_nav_menu. Is there a way to have the menu name displayed inside an h3 tag before the menu? Ex. <h3>My Menu Name</h3> <nav> ...
5
votes
4answers
8k views

Add Class to Specific Link in Custom Menu

I know you can add a class in the custom menu options, but it adds it to the LI before the A. I want to apply the class directly to this specific A rather then the whole LI. So instead of the output ...
2
votes
2answers
1k views

Bar separated navigation by extending Walker_Nav_Menu

I have the following menu in my header: <?php $args = array( 'menu' => 'Main Menu', 'container' => false, 'depth' => 1, 'items_wrap' => ...
2
votes
3answers
5k views

Hide Admin menus per role in Wordpress

I am trying to hide a certain amount of menus for a client. Right now I am using the following code and it is doing its job well, but it removes it for everyone as far as I can tell. As in all roles. ...
7
votes
3answers
3k views

remove “edit your profile” from admin menu bar

How can I remove "edit your profile" submenu under "my-account-with-avatar" admin menu bar, while still keeping the avatar and logout?
6
votes
2answers
6k views

How to manually specify the current active page with wp_nav_menu()

Is there a way of manually specifying which page is currently "active" when using wp_nav_menu()? I have a "Products" page, and on that page I have links to various (dynamic) custom taxonomies. When I ...
4
votes
1answer
290 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?
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 ...
2
votes
1answer
965 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 ...
2
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 ...
1
vote
1answer
339 views

Customizing the a tag with Semantic UI

I'd like to use Semantic UI to aid development of a Wordpress template for a project. For a submenu I intend to use one of the Secondary sub menus found just at the bottom of the Pointing section. ...
1
vote
1answer
5k views

wp_get_nav_menu_items how to exclude sub level menu items?

I have the following function to output a custom menu in select format for a responsive design I'm working on. It's working exactly how I want it to apart from I would need to exclude sub menu items. ...
1
vote
2answers
2k views

Filter out built-in wp_nav_menu classes but keep custom class

Im trying to remove / filter our all the classes from the wp_nav_menu, EXCEPT the custom ones that i insert (in the "CSS Classes (optional)" field) when creating the menu in the admin. I found a ...
1
vote
2answers
1k views

Show recent posts in menu?

I'm building a menu which contains categories. Is there a way to make each menu option show a list of recent posts in that category when you hover over it?
1
vote
1answer
915 views

Menu with Automatic Pages Included from Custom Post Type

Question - How can one utilize the wordpress 3.0 Menu system to automatically have new pages from a custom post type included within the menu (I am referring to the Menu Management area of wordpress ...
7
votes
1answer
561 views

Assign a Class to the Current “Tag” for Formatting

Essentially what I am hoping to replicate is something like the "current-menu-item" class that is applied to WP Menus. My client is wanting to use Tags as a sub-nav, and I've managed to get the tags ...
4
votes
2answers
251 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
1answer
678 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 ...
3
votes
1answer
4k views

show current navigation path from menu

I want something like this Home > Products > Steel > Nails This information should come from the menu structure! I installed Breadcrumb NavXT but it seems that it only takes the path I defined (this ...
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
2answers
878 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 ...
2
votes
0answers
119 views

All Menu Items Disappear Seemingly at Random [duplicate]

For the last month or so, seemingly at random and with no discernible pattern, my menu disappears. However, when I look at the Dashboard, what I find is that all the menu items have been deleted but ...
2
votes
1answer
2k 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> ...
1
vote
1answer
62 views

Unregister Nav Menu with fallback?

I am trying to create a child theme so theme updates are much easier. I want to remove the parent theme menus and add my own. I know I can modify the header.php file (where these menus exist) and ...
1
vote
2answers
674 views

Adding a Nav menu to post admin

i want insert a dropdown menu with list of menus, that i've created in nav-menu.php, to post-admin... For example, when i'm creating a post, i want insert a menu "Paul" in a post (only a post that i ...
1
vote
2answers
4k views

How to style current page menu item when using a walker

I have designed a custom menu and would like to be able to style the individual li dependent whether it is the current page or not? I believe this is normally pretty straightforward using a class such ...
1
vote
2answers
439 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
1answer
1k views

Get menu object from theme_location

I'd like to get a menu object from its theme location argument. My goal is to output separately the menu name and its items name, url and description. Example of what I'm looking for : $menu = ...
1
vote
1answer
848 views

simple expandable vertical menu, java script problem

I am trying to create a simple expandable menu in wordpress. Bellow you can see the javascript I am using (copy and mix from internet). <script type="text/javascript"> ...
1
vote
1answer
2k views

change front end menu depending on user login

How can i change my front end menu depending on if the user is logged in or not? For Example: View 1: user is not logged in menu is : home , about us, testimonials View 2: user is logged in menu ...
0
votes
1answer
1k views

Add child pages automatically to nav menu

I have built a custom menu in Wordpress that contains links to posts and pages. I am adding it to my header using this line of code: <?php wp_nav_menu( array( 'theme_location' => ...
0
votes
1answer
3k views

Adding attributes to <a> link in wp_nav_menu using custom Walker function

I am trying to generate a menu using wp_nav_menu. My expected output is this: <!-- Main Menu --> <div class="navbar navbar-blue navbar-fixed-top" style="margin-top:74px"> ...
0
votes
1answer
1k views

How to include the 'current-menu-ancestor' class on a custom post type menu in Wordpress?

I need the Wordpress menu to include the 'current-menu-ancestor' class to reflect that site is currently in the recipe section. Supposing I have a recipe custom post type. I have the following code in ...
0
votes
1answer
645 views

How to make a plugin auto-add item to nav menu

I'm building a contact information plugin that writes data to a page. So far, so good. What I would like is to build a function into the plugin that adds a navigation item to the main nav bar on the ...
0
votes
2answers
1k views

Adding html elements to wp nav menu

I know how to create wp menus using the functions.php and diaplay it in my sote wherever the menu is required (e.g top menu, footer menu) I even know how to style it using custom CSS. I would like to ...
0
votes
2answers
852 views

Conditional custom menu?

I'm trying to create a custom menu that displays a <li></li> when a user is logged in, and not display it when they're not. I have this so far, but it's not working. Does anyone know how ...
0
votes
2answers
804 views

How to add pages to custom menus on the fly [duplicate]

Possible Duplicate: Can I add pages to my custom menu via script? My theme has a custom menu called "Custom Header Menu" and i've got a plugin that sets up site defaults and creates my ...
4
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 ...
3
votes
4answers
3k 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
6answers
4k 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
1answer
839 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 ...