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
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
1k views

Adding custom text in items titles from wp_nav_menu()

I need to add something after each title of a specific menu called by wp_nav_menu() I tried add_filter('wp_nav_title', 'testing_stuff'); with function testing_stuff() { $item->title = ...
1
vote
3answers
6k views

Show just one level of child pages, wp_list_pages woe

I'm working on a site that has a fairly large page structure a few levels deep - in some sections there are a lot of pages. The basic setup is something like this... Parent Parent Parent -Child ...
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
4answers
1k views

How to set classname for <li> tag in wordpress menu?

I am using. <?php wp_nav_menu($args); ?> for get menu from wordpress.it returns the menus with <ul> and <li> structure. In that i need to set class name for every <li> tag ...
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
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
4k views

Remove li from wp_nav_menu

How can I remove the li from wp_nav_menu? I know I can remove ul but is it also possible to remove the li? I would want to do this on just one menu not all the menus on my site.
1
vote
3answers
1k 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 ...
1
vote
2answers
1k views

How do I remove the link element from the current page in a wp_list_pages menu?

WP makes a list of links, and helpfully applies a current_page class, but I'm concerned with the accessibility issues of a link to the page you're on. Normally I'd swap the <a href etc with a ...
1
vote
2answers
676 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 ...
1
vote
1answer
876 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 ...
1
vote
1answer
179 views

I'm having a lot of trouble since upgrade to 3.0.1 with get_page_children() function

I use the get_page_children() function to create a sub_nav for a designer client I do work for. She uses the Spry Assets flyout JS that DreamWeaver creates, so I have to manually do the menus like ...
1
vote
1answer
3k views

How to make a custom menu based on a category or tag?

I'd like to have a sidebar widget that has my latests featured posts, which would be marked as a category or tag. Is there a way to do this with the new custom menus, and if not, is there a plug-in ...
1
vote
1answer
14 views

Is it possible to add a filter for the output of nav-menu items in admin?

I want to remove certain input fields on the admin screen for nav-menus for specific menu positions. I've used filters to filter front-end output but not for admin output. Is there a filter available ...
1
vote
1answer
30 views

Logout and redirect using the WP Menu

I have a navigation hyperlink in my secondary menu, that will allow the user to logout: However, the user is prompted with the following screen for confirmation, when clicking on the hyperlink in ...
1
vote
2answers
64 views

Set the active Navigation Menu from a plugin

Is there a way to set the following option from a WordPress plugin, if you know the name of the menu you want to set: My developer says it's not possible, but I am sure on of you gurus knows a way ...
1
vote
2answers
26 views

Check if menu id = $specific_id - then insert specific <img>

I currently have a menu structure as followed: <ul class="level-1" id="menu-menu1"> <li id="menu-item-411"> <a href="http://www.link.com">Frontpage</a> </li> ...
1
vote
2answers
889 views

WordPress get or set active menu class

How to get active menu class in wordpress, I want to get it in one plugin to change menu style. Just to clear, I do not want active menu element class. <ul id="menu-scroll" class="nav-menu"> ...
1
vote
1answer
1k views

Add class to active element and its parent in nav menu

I am using the following code in order to add a class name "active" to the current menu item: add_filter('nav_menu_css_class', 'add_active_class', 10, 2 ); function add_active_class($classes, $item) ...
1
vote
1answer
595 views

Show Different Custom Menu on Different Category Pages

I have been using in_category function to display a set of menu on the sidebar. However, a much better way would be to show this menu on the top, as a navigation menu -- in the form of custom menus. ...
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
258 views

How to remove a metabox from menu editor page?

I am not sure if it is much different for any page but I am wondering how to remove a metabox from the appearance>menu page without having to go into the wordpress core files and remove it. Is there ...
1
vote
1answer
355 views

Set default screen option for appearance -> menus

Is it possible to have any control over the screen options for Appearance>Menus. I am working on a theme and with a fresh Wordpress install where I had never touched any of the screen options ( at ...
1
vote
1answer
450 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 ...
1
vote
2answers
104 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 ...
1
vote
1answer
48 views

Find the Children of a Page then Echo it as a Bulleted List of Links (menu)

I am trying to check if a parent Page has children. If it has children I would like to echo the children as a bulleted list with links to each child (basically a menu). Right now I have the following ...
1
vote
1answer
193 views

Add items to a menu dynamically

I'm doing a site in WP with dynamic and static content. I'd create the menu from the admin panel. I have 5 sections (Home, about, Boats, News(blog), contact). I'd create a custom post type with new ...
1
vote
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
2answers
79 views

Does loading of sub pages in menu cause load to the server?

I am working on a wp site where I need to manage 500s of child pages for a single page such as About menu can have more child pages need to manage those child pages as sub menu and I have more than 5 ...
1
vote
3answers
3k views

Convert WP Menu to a Drop Down for Mobile browser

I'm working on a wp project with responsive theme. I have single level nav menu at the top of the site, that I want to change to a Select Option tag for mobile browsers (small screens) with options ...
1
vote
2answers
60 views

Sidebar links for different pages

Hey all i am wondering what i need to add in order to have a different sidebar for a set page? I created a category for the page (called PatientEdu): And made sure the page was linked to the ...
1
vote
2answers
411 views

wp_update_nav_menu_item not saving in multisite API

I'm creating a script that automates build a wordpress site from another CMS. I've been able to change every setting: themes, options, subdomain, site title, etc. But what is eluding me is being able ...
1
vote
1answer
92 views

Get admin menu link

Is there any way I can get the menu link for admins? http://codex.wordpress.org/Function_Reference/edit_post_link Similarly to the edit_post_link() that returns the edit link for loggedin Admins I ...
1
vote
2answers
562 views

Create dropdown list post

I want to create a drop down list that will list all the posts in the category. I want the drop down list to appear on every post. So for example if I view a post that belongs to category Apples it ...
1
vote
2answers
2k views

How to add php to custom link in the nav menu?

I simply want to add some php in as a custom link in the wordpress menu section. The code I want to use is <?php bp_loggedin_user_domain(); ?> which will generate that logged in user's ...
1
vote
1answer
97 views

Where do I add html code to the menu div?

When looking at header.php, I see the following line: <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> That function is defined in nav-menu-template.php and generates the ...
1
vote
2answers
3k views

Search box as a menu item in the nav menu output by wp_nav_menu?

I am using the Twenty Twelve theme, and the following is the code it uses to register and display the menu. In functions.php: function twentytwelve_setup() { ... // This theme uses ...
1
vote
1answer
81 views

Should I use custom menu, C.P.T. or theme options, or something else for this?

On many sites ( particularly CMS style business sites) there are 2, 3 4 or sometimes more boxes usually containing a title, icon and some text. These appear under the header linking to strategic parts ...
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
2k views

How do I fix this error: Warning: invalid argument supplied for foreach()?

I recently moved a wordpress install from my local instance to a dev server. For the move, I installed a clean version of wordpress 3.4, moved exact duplicates of the file structre, and used the ...
1
vote
4answers
947 views

how do I add “home” menu item conditionally to custom menus?

Original question How do I get menu items using slug and not ID I need to get a specific menu, but I can't use ID, since the menu ID on my dev is not the same as on my staging and prod server. ...
1
vote
1answer
224 views

get_search_form() doesn't appear to take parameter into account

I am creating a menu manually and trying to include the search form. this is taken from the Wordpress Docs "Building a simple menu list" at ...
1
vote
2answers
75 views

Did upgrading from 3.3 to 3.3.1 introduce breaking changes in the menu navigation?

I have a WP 3.3.0 site running in production. (version.php says $wp_version = '3.3';) I have a main menu using WP's built-in functionality. I use wp_nav_menu(array( 'container_class' => ...
1
vote
2answers
390 views

Open subcategories in submenu on click in primary menu

I am figuring out a way if we can manage the menu in such a way that when I click on the menu item in the first menu, the sub categories or links that i choose should be displayed in the secondary ...
1
vote
1answer
973 views

How to add Categories to the top menu of the website?

How can I add links to the categories (for example, Category-1) to the top menu of my WordPress blog? Only Pages appear here.
1
vote
1answer
289 views

Adding all sub-pages to the menu manager

Is there some simple way which would allow one to add a page to a menu (through the menu manager interface) and be able to define if the inclusion of this item should automatically add all subpages up ...
1
vote
3answers
3k 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
2answers
17k views

How to Create a Custom WordPress Navigation Menu with the Code?

Without using plugins, how to create a custom WordPress navigation menu with the code? I have Wordpress ver 3.2.1 and Buddypress ver 1.5.1 I would like to create a menu like this: click here I would ...
1
vote
2answers
251 views

Menus, but not by theme location

I'm trying to figure out how to display a menu that has been created, but without having to assign the menu to a theme location. From what I can tell, you have to assign a menu to a theme menu ...