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)

0
votes
1answer
28 views

Retrieve Menu name for nav_menu_item

Given a nav_menu_item object, how would I determine the name of the Menu it is associated with? I have a couple menus defined in my theme, as well as, a nav_menu_css_class filter. Inside the filter, ...
0
votes
1answer
46 views

Use wp_nav_menu to display ALL pages

I am currently building a wordpress theme. For the menu, I just want to display all the pages that are created in the order that they are created in (i.e. I don't want users to have to go into the ...
0
votes
1answer
550 views

Custom Nav Walker sub-menu HTML construct

I've got my Custom Nav Walker set up and it works fine with the main menu items, and displays them how I want. However the same HTML is being applied to the sub-menu elements which isn't what I want. ...
0
votes
1answer
35 views

Add a string after each item in Wordpress sub menu

I am trying to add a special character to display a » alongside each menu item in Wordpress. So for example About us » Contact us » And so on... Here's my code <li><?php echo ...
0
votes
1answer
170 views

How to get current page nearest parent id?

I am trying to get current page nearest parent id not top-level. For example I have added page like this: Now If I am in Junior Design Award 2013 page I want to get his parent id 765 not top-level ...
0
votes
1answer
22 views

Custom HTML output for registered navigation

Is it possible to strip out the title / url from a custom navigation as to create a new HTML structure? I'm creating a very unique menu structure, based on the custom menu created by a user in ...
0
votes
1answer
49 views

Generate Navbar In WordPress

I am currently developing a custom theme. I need to generate menu with submenu. By default wordpress provides me result like below: <ul id="side-menu" role="navigation" class="main-menu nav"> ...
0
votes
2answers
145 views

wp_nav_menu (secondary menu) not adding current classes

I've looked everywhere, but i can't find a solution. My secondary menu isn't adding any current classes to the tags when it's rendered. I have added this menu in my functions.php file function ...
0
votes
1answer
55 views

how to add a div inside wp_page_menu

Right now I'm using the <?php wp_page_menu('menu_class=nav'); ?> function, which gives this result: <div class="nav"> <ul> <li class="page_item ...
0
votes
2answers
39 views

Add # to submenu URLs automatically

I'm trying to replace all my child page URLs to include a # automatically example: http://www.website.com/parentfoo/#childfoo I tried using wp_setup_nav_menu_item to run through all the child menu ...
0
votes
1answer
19 views

Showing home button in a specified menu

I try to add the home button in a specified WordPress menu (I have 2) and it's not working at all. This is my code: <?php wp_nav_menu(array('theme_location' => 'primary', 'show_home' => ...
0
votes
1answer
197 views

Drop Down menu expanded by default (on front page) [closed]

For this site users seem to have difficulty finding the site's content that is accessible through the 'Data' drop down menu on the top left. To improve this I would like to have this drop down menu ...
0
votes
1answer
88 views

Auto add pages to primary menu with functions.php

Is it possible to have new pages automatically added to the primary menu via functions.php? This particular theme will be deployed on a special version of multisite, so the checkbox which is ...
0
votes
1answer
337 views

Change menu items URL

I create a single page website and use only anchors (#) on main menu items. Now, I need to include a second page on the website and keep the same menu. I'm using roots theme. Then, I'm building menu ...
0
votes
2answers
126 views

Second menu has the first menu ID

I registered two menus top-menu and main-menu. I created two menu on the admin panel and assigned one to each (different items) But when I view the front end, I see that the two menus have the same ...
0
votes
1answer
23 views

search form leads to 404

I'm using the follow code in my functions.php to add a search box to my primary nav menu - add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2); function add_search_box_to_menu( ...
0
votes
1answer
24 views

How to change the menu like this?

Here is my wp_nav_menu: wp_nav_menu( array( 'link_before' => '<span><strong>', 'link_after' => '</strong></span>' ) ); I got a tag ...
0
votes
1answer
19 views

Odd spacing in Navigation Bar [closed]

I am in the process of redesigning my website, and i'm struggling to find what is causing spacing (margins i'm assuming) between navigation items. I have been delving through chrome developer tools ...
0
votes
1answer
27 views

Show subpages of a category in a custom menu

I have added a post category to a custom menu through Admin. But when it shows, it just shows the category name, and does not show the posts inside the category. Is there a way to add an args; that ...
0
votes
1answer
23 views

When filtering query on custom taxonomy; main menu dissapears

I have created a custom taxonomy, and that works. But here is the problem; I have created an archive page, which in the url gets e.g. this: ?category=23. Then, in functions.php, I do this: function ...
0
votes
1answer
161 views

Does this function wp_get_nav_menu_object check if a nav menu exists or is supported?

function wp_get_nav_menu_object( $menu ) { if ( ! $menu ) return false; $menu_obj = get_term( $menu, 'nav_menu' ); if ( ! $menu_obj ) $menu_obj = get_term_by( 'slug', $menu, 'nav_menu' ); ...
0
votes
1answer
170 views

Add third level menu on wordpress

I would like to add a third level menu on WordPress. This is the code I've added to the functions.php file to create the secondary menu, but when trying to repeat the same code with a third menu, I ...
0
votes
1answer
100 views

Custom ul class

I need help for my custom Wordpress Layout. It should look like this (HTML): <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li> ...
0
votes
2answers
682 views

Ways to give a wp_list_pages menu link specific class names?

I'm looking to style my wp_list_pages with a span class. I'd like to give it a unique class so that I can give each a specific icon. 'link_before' => '<span ...
0
votes
1answer
332 views

Add class to all list items of wp_nav_menu

I have a wp_nav_menu to which I want to add a classes to the list items. I know this can be done by choosing 'css classes' from the screen options menu, but then I have to give every single li a ...
0
votes
1answer
59 views

Some doubts about WordPress handle the horizontal main menu visualization

I am pretty new in WP (I came from Joomla) and I have some doubt regarding how WordPress handles the main menu (I mean the horizontal menu in the header). As example I use this online test website: ...
0
votes
1answer
57 views

Why in this WordPress theme I can't see the Main Menu?

I am pretty new in WP (I came from Joomla) and I have the following problem. I have installed WordPress on my server and if I use one of the included theme (such as the Twenty Thirteen theme) when I ...
0
votes
2answers
118 views

Wordpress cache a menu with Transients_API

I want to plain to cache a page menu, that takes about 50 queries on page load. At the moment i have cahche setting code with Transients_API <?php $housemenu = ...
0
votes
1answer
59 views

Unable to add extra elements to the main navi (wp_nav_menu_items)

I'm trying to get the list of authors to automatically appear on the main navi (without having to manually add them one by one as they are created). So far I added this on my functions.php, but no ...
0
votes
2answers
72 views

wp_nav_menu inside an object — how do I deal with fallback_cb?

I'm trying to create a class that allows me to generate a navigation menu. Here's a simplified version of what I'm using: class PJ_Menu { function make_menu() { $args = array( ...
0
votes
1answer
129 views

Appearance > Menus > Left Sidebar > Add Toggle

How can i add my own toggle here ? There are toggles for each post type but I would like to add this without creating a new post type. Where should I start looking ? Let say I wish to add something ...
0
votes
1answer
174 views

Show login greeting above sub-menu links?

I'm using WordPress' built-in menu system to output my Main Menu Structure. I have one sub-menu, and it has two links currently, "Tracking" and "To-Do List". I want the following login greeting to ...
0
votes
1answer
171 views

Responsive menu on genesis theme [closed]

Hi I'm customizing a Genesis framework theme Jane and I want to change the menu to be responsive with Twitter Bootstrap. I already found an question how to override the genesis_do_subnav function ...
0
votes
1answer
276 views

How to avoid the <div> and <ul> which added when custon menu widget is used

I need to remove the custom menu widget <div class="menu-main-container"> <ul id="main" class="menu"> from appearing above the <li>. Because of this two lines my menus are not ...
0
votes
1answer
33 views

Question about Menus on Wordpress

I have a question regarding something that is not working properly, I have a menu that is not working, currently with my theme I have 10 menus, one being the main nav and the rest are needed for ...
0
votes
1answer
129 views

Parent Page > Child Page Menu

I am trying to create a collapsible menu using Bootstrap. The problem I am having is getting the correct Wordpress PHP code to call the right pages. Also this menu will be displayed on these child ...
0
votes
1answer
46 views

How to conditionally add a wp_filter

I have a WP filter I created that I only want to run on certain menu items. I am attempting to use - function add_nav_class($output) { $output= preg_replace('/<a/', '<a class="lsbb"', ...
0
votes
2answers
447 views

How do I programatically insert a new menu item?

I'm developing a plugin and I want to insert menu items programmatically. When my theme creates a menu, it uses this call: wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => ...
0
votes
2answers
72 views

Change appearance based on category but post is in two main categories

I want to change header and menu based on what category a post is listed in. I could duplicate the post and assigned each of the two categories separately but this sounds messy and bleh. The post/s ...
0
votes
1answer
23 views

Opening Menu link in another tab

I am adding a link to my Menu: Everything is working correctly except I would like the link to open in another tab and can't figure out how to. How would I do this?
0
votes
1answer
80 views

Menu link to all posts (all categories included)

In WordPress how can I add a menu link to an archive for Posts? I can see that I can add category archive links but what if I want to have an archive of all the posts (therefore including all ...
0
votes
1answer
114 views

How to create a complete mulilanguage site using xili language plugin?

I am using xili language plugin for create a multi language site. Using this i can create posts and pages on different languages. But when i switch to other language the menus doesn't converted to ...
0
votes
1answer
33 views

Making pages in a menu appear conditionally

How do I make a page (dis)appear conditionally in a menu? I had something like this in mind: if(condition) //show_page_in_menu I would prefer an answer that doesn't incorporate an external ...
0
votes
1answer
19 views

Creating custom menu with custom themes

I have created my own custom WordPress theme and am now trying to implement the custom menu. I noticed with the default theme that when I went to Appearance > Menus, I was able to create my menu ...
0
votes
1answer
951 views

How to add class to anchor using wp_nav_menu

Sorry if my post duplicate but i can't find best solution for my problem. I'm newbie on develop WP theme. Now i'd like to add class to current li and last li, but i don't know how to do? Hope someone ...
0
votes
1answer
495 views

Modify the output of wp_nav_menu in a very specific way?

I am trying to get wp_nav_menu to output something like this: <div id="topMenu" class="spanningMenu noPrint"> <ul> <li class="topMenuDivider"></li> ...
0
votes
2answers
273 views

wp_nav_menu does not take arguments?

I am sorry for this nooby question, but I just don't get it : I was working with the function reference for wp_nav_menu and this is my line of code: <?php wp_nav_menu( array('theme_location' ...
0
votes
2answers
2k views

How to display the title for each menu item in a span attribute

I'm trying to add a CSS hover effect to my theme's main menu and the effect is based on an attribute passed in a <span> element. The problem is that I am unable to produce this dynamically with ...
0
votes
1answer
129 views

Switching to child theme breaks menu names

When I switch to the child theme I am working on, the main menu uses the page names instead of the names that I gave it in the Appearance > Menu options. Happened to anyone else?
0
votes
1answer
15 views

Expected snippet value not showing

I have a code snippet like this one, <div class="container"> <ul id="menu"> <li> <a> <i ...