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
4answers
13k 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
3k 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
7k 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 ...
1
vote
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' => ...
1
vote
3answers
4k 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
5k 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
280 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
1k 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
5k 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 ...
1
vote
1answer
147 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
4k 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
877 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 ...
15
votes
2answers
4k 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 ...
7
votes
1answer
535 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 ...
3
votes
1answer
3k 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
815 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 ...
1
vote
2answers
630 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
3k 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
352 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
914 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
805 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
2k 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
957 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
504 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
809 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
763 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
920 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
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
1answer
539 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
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
769 views

How to change menu according to the language?

I want to change primary menu according to the language of the user. I have reviewed multi language plugins such as WPML and qTranslate. They have lots of features but what I want is much simpler than ...
2
votes
1answer
572 views

Assign Menus to Theme Locations with theme activation

A site is using "child1" named child theme. When this site switches to other child theme named "child2", their widgets are moving too but theme locations are not moving. How can i auto assign menus to ...
2
votes
1answer
837 views

Custom search filter causes menu and query_posts problems

I'm using a custom search filter (using my custom query var type), like so: function fteh_pre_get_posts( $query ){ if( isset( $query->query_vars['type'] ) ) $types = explode( ',', ...
2
votes
2answers
693 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
1answer
1k views

BuddyPress - How to add logout in nav menu

How to add a logout option to the main nav menu (not to the top bar) in BuddyPress?
2
votes
2answers
604 views

Organizing by super-categories (or nested categories)?

Suppose I want to blog about three somewhat unrelated main topics: Money, Languages, and Information-Technology on the same blog. How should I organize things for the best user experience? How does ...
1
vote
1answer
49 views

Create a Page via plugin

My problem is to show a list of products read from db tables. I know how to read them and I am able to produce the table, but only using a shortcode embedded in a page that I've created via WP. I ...
1
vote
2answers
53 views

Create a select drop down of available menus

I'm attempting to create a custom field on my page creation that allows a user to choose which menu to display on the page. Right now I have my custom meta field setup, but can't figure out how to ...
1
vote
1answer
1k views

wp_nav_menu - show children of current menu item only?

I am trying to create a menu structure with a simple concept: A horizontal, 1-level deep main menu A vertical submenu, that contains children of the current main menu item (2 levels deep) Of ...
1
vote
2answers
196 views

Select menu on browser resize

I have seen on some wordpress themes that if the browser width is less, the normal menu becomes a select menu. Can someone tell me how it is done? I know there is a plugin for that, but I want to ...
1
vote
2answers
885 views

Wordpress Menu Disappears when $query->query_vars['meta_key'] is set

I've set some meta variables on my WP posts. I want to be able to sort by these variables, and everything is working great except when I sort by either "views" or "likes". When I sort by either of ...
1
vote
2answers
1k views

Get parent page/menu id of current post

Basically, after setting up the initial "page for post" on the Reading Options, and then add that page to the menu I get the posts when I click on that menu item as expected. On there I know the post ...
1
vote
1answer
709 views

insert element inside wp menu list item

I am not sure if it is clear from the title what I want to achieve here so let me try to clarify this. I wanna make use of Wordpress's menu system and need to adjust it to my needs, which means that ...