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)

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
840 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

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> ...
2
votes
2answers
527 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
207 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
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 ?
2
votes
2answers
877 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
1k 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
2k views

wp_nav_menu always falls back to a menu

hey all, i'm writing an automated function that generates a menu from a function. it calls wp_nav_menu on each item from an array, because i want this to be dynamic. the problem is, no matter how i ...
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. ...
2
votes
3answers
348 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
78 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
1answer
4k 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
774 views

Pulling Featured Images in to a WordPress Menu

I've got a simple static list marked up like this that I'd like to turn in to a WordPress Menu: <ul> <li><a href="#"><img ...
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
1answer
971 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
2answers
5k 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 ); ...
2
votes
1answer
68 views

What Defines What Category A Post Picks (if in multiple)

If I have a post in multiple categories, what defines what category shows up in the URL? Assuming I have permalinks setup as /%category%/%postname% is it the ID or the name?
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 ...
2
votes
2answers
4k views

What's the easiest way to duplicate an entire navigation menu?

What's the easiest way to duplicate an entire navigation menu? I don't care if it involves SQL commands or whatnot. I just have some really big menus that I'd like to duplicate. Didn't see a plugin to ...
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
1answer
658 views

WP_nav_menu fallback not working

I just realized the fallback doesn't work for my project when a custom menu doesn't exist. I can't figure out what I am missing. Here is the code that displays the nav menu: $menu = wp_nav_menu( ...
2
votes
3answers
547 views

HTTPS page link in menu

Ok, so I have a wordpress site with a lot of pages and menus that I've defined in the appearance/menus section of wordpress. One of my pages has a little payment form on, which I'd like to link to ...
2
votes
2answers
621 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 ...
2
votes
4answers
1k views

How to fix strange 500 Error after Editing Menu?

I have strange situation which just started which I seem to be unable to resolved. I am not sure what this might be related to but I think I remember reading somewhere that this has happened to ...
2
votes
2answers
660 views

Renaming Menu Item within Admin Menu Section for a Custom Post Type?

I have a feeling this is a bug. When you create a new custom post type it does not seem possible to modify the first submenu item text. I am referring to the link which allows you to view the post ...
2
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 ...
2
votes
2answers
651 views

How to add post count to wp_nav_menu?

Is it possible to add post count to menu links using wp_nav_menu? For example:- Apple (3) ball (6) cat (2)
2
votes
1answer
262 views

wordpress custom post type remove duplicate menu item

I've registered a new content type with following - register_post_type('news', array( 'labels' => array( 'name' => __( 'News'), 'singular_name' => __( 'News'), ...
2
votes
2answers
952 views

Hide main div if wp_nav_menu is empty

I want to hide the div class "navmain2" if the menu is empty. See code below: <!-- Start main navigation --> <div class="navmain2"> <div id="logo"></div> ...
2
votes
1answer
371 views

Make compatible custom menu widget for Twitter Bootstrap

If I configure wp_nav_menu function, I can put the "items_wrap" option to achieve a nice navigation given by Twitter Bootstrap, thus: <ul class="nav nav-pills">%3$s</ul>. But, how to ...
2
votes
1answer
895 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
809 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
924 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
1answer
533 views

Best practices: Custom theme sidebar menu - hardcode or widget?

Is it best to hardcode a sidebar menu using functions.php or sidebar.php OR use the custom menu widget? Are there times when each is appropriate?
2
votes
1answer
397 views

Menu highlight custom post type archive

I am a WP beginner and hope if anyone can help me out. I have recently installed WP 3.3.2 and Jigoshop 1.2 to see how things works if I can use WP as an ecommerce website. The problem I am facing at ...
2
votes
1answer
1k views

Sub-Pages only of menu items in current branch using a custom menu

Although I did a thorough research I could not find a solution. Only solutions coming close. My custom menu ("top") shows this structure (you see a part of it): page 1 subpage 1.1 category A ...
2
votes
3answers
1k views

Hide and show menu subpages

I am sorry if this is not clear, but I am using translated wordpress so I am translating some names back. I have pages in menu and when I click on some item it goes to that page. But I need f. e. ...
2
votes
1answer
906 views

Manipulating menu HTML

My site's menu uses the built-in menu under Appearance >> Menus. I want to make a very simple change: I want to wrap each of my menu's second-level ULs in a DIV. What's the simplest way to accomplish ...
2
votes
1answer
1k views

Add meta data to the menu

I encountered this problem what i thought to be one of the worlds simpliest things, I wanted to add a subtitle to the menu somethin alike this http://img4.imageshack.us/img4/7816/unled10b.png . Then i ...
2
votes
2answers
953 views

Add column to pages table

Hey all i am trying to find the section within the edit.php page where it populates the table with all my current pages. What i want to do is add another colum to the table in order to launch a side ...
2
votes
5answers
727 views

How do I highlight the menu for a child page?

EDIT: This used to be How do I force a page to be is_archive == true? I was trying to solve the wrong problem. Instead of forcing the post/page to have a particular attribute, I should have ...
2
votes
1answer
271 views

Accesibility problems with dropdown menus in twentyten theme or others

Some time ago I discovered that dropdown menus that do have clickable links on parent nodes are confusing for the users. Often they are not seeing that they can click on the parent, they just assume ...
2
votes
2answers
398 views

adding .current* tags to custom post types and taxonomies

TwentyTen adds some classes to custom menus, for instance: #access #menu-item-262.current-menu-item, #access #menu-item-262.current-menu-ancestor All the top-level links in my primary navigation ...
2
votes
1answer
1k views

How to get custom post type menu_name?

I'd like to show the post type of a post, you can do that with get_post_type(), but in my case the names are not pretty (for ex : p_project_plans). So instead I thought I'd show the asociated ...
2
votes
1answer
2k 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
543 views

How to manually add an item to a submenu in a menu generated by wp_nav_menu?

Hey. I've been trying to figure this out for a long time but can't seem to crack it. I have created a menu using Wordpress 3 menu editor and it's all fine and working. But I want to manually add an ...
2
votes
1answer
74 views

wp_nav_menu() not working on Custom Search Page

I'm using WP Custom Search plugin to generate Advanced Search in one of my newly developed WP site. Though the plugin is not completely bug-free, but it's working just fine (excepts some Undefined ...
2
votes
1answer
1k views

Show top-level parent with submenu menu walker

I've used the menu walker below to display dynamic submenus with great effect in the past. It displays 2nd- or lower-level menu items IF the current page is a parent, sibling, or descendant of the ...
2
votes
1answer
34 views

WordPress – site with 2 stylesheets and more…

I’m building a site that is broken up into two views (or sections): College and Corporate. » See it here When the College tab is active, the site will use college-styles.css (orange background) ...