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

Can you have different menus and theme on a per-page basis?

I am planning to have a new site created using WP pages. My company is focusing on 3 or 4 discrete areas and one of those I want to promote in particular, with its own set of pages. Ideally it would ...
2
votes
2answers
6k views

How can I show different menu for different pages?

I have a website that has a main menu(Top-Horizontal) like this: Main menu - Home - About Us - contact us On Home page I have a link to "Company" page like this www.xyz.com/company. When I am ...
0
votes
0answers
32 views

how to keep currently selected menu item while selecting another menu item in second menu

In wordpress 3.9.1 I'm trying to create my own theme. One of the things my theme should be able to deliver is to have two menu's. I do have that. It is working. So no worries there. One of the ...
0
votes
0answers
20 views

Creating Secondary Menu - all steps required?

I am using retro hipster theme and have been able to add secondary menu with details. I've read regarding adding array in functions.php and then calling both nav in the header.php. However one 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
0answers
49 views

automatically adding submenu items

Here's the solution that @bainternet has posted here: Add child pages automatically to nav menu /** * auto_child_page_menu * * class to add top level page menu items all child pages on the fly * ...
0
votes
0answers
22 views

wp_nav_menu: current_post_ancestor-category parent

I have a nav like this: page 1 -- page 1.1 -- category 1.2 page 2 page 3 When I am on a single post in the category 1.2, the category-menu-item gets the correct class current-post-ancestor and ...
0
votes
0answers
46 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
0answers
21 views

how to proceed for a “new!” label on menu_nav? [duplicate]

I'm developing in Wordpress and would like to assign the label "new!" to specific custom-post-type's (not necessarily all post-types) if they contain new posts in the last 30 days. I found this code ...
1
vote
0answers
34 views

Unlimited WordPress Menu

I am limited to like 80 menus. My menu consists of 1000 menus. How can I increase the limitation of Appearance > Menu I tried modifying the php.ini (using reseller account) and increase the max_var, ...
0
votes
0answers
29 views

When submitting more than 200 menus, I get “Service Temporarily Unavailable”

I have a site with a large number of nested menus. I solved the problem after following the solution proposed here Menu limit, cannot add new menu items and including max_input_vars setting. For ...
2
votes
1answer
906 views

Vertical Sidebar Menu Parent and Child not displaying correctly [closed]

I am developing a WordPress site and trying to display my menu correctly. How can I display all Parent items but only show the Child items when it's Parent has been selected. I hope that makes sense. ...
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 ...
5
votes
2answers
2k views

Custom Post Type Menus

I'm writing a plugin for work because our main website is being ported to WordPress eventually. I've got multiple custom post types planned for this plugin and would like to group them all into one ...
0
votes
2answers
2k views

Get menu item slug

I use custom menus and I’d like to get the menu item slugs. Is that possible? // Get the nav menu based on $menu_name (same as 'theme_location' or 'menu' arg to wp_nav_menu) // This code based on ...
0
votes
1answer
148 views

Next/previous a-like single navigation

I have on the site navigation menu which uses next/previous functionality to navigate through the site. Currently it is a hard coded image map with related links on each page. I know how to get ...
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
1k views

How to make a drop down menu with categories

I'm building a website in which there is a navigation menu with various links; in this menu there is the link to the blog section. My goal is to create a drop down menu that appears when the cursor ...
0
votes
2answers
101 views

Override custom menu widget

I would like to override some mark-up and css (like <div class="soma_container"><ul class=""></ul></div>)styling on a chosen custom menu widget. How would I do that? Should be ...
0
votes
1answer
100 views

Theme: Twenty Thirteen Mobile Sliding Menu Doesn't Bump Content Down

I have created a child theme for Twenty-Thirteen and somewhere while editing it I broke the mobile menu slider as it no longer pushes the content down and instead displays behind the content. I've ...
0
votes
1answer
553 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
2answers
136 views

Current menu item

I'm trying to figure out why my text is not showing white as it should. I'm overriding bootstrap.min.css in style.css the current-menu class in Wordpress, but no success. It highlights the right ...
6
votes
3answers
7k views

How to add a Custom Link to a Menu with an URL that is relative to the blog URL

Part of my work is to create Wordpress websites. I usually work on my laptop until I have something good enough to be uploaded to the test server where the client reviews it. I create a VirtualHost ...
0
votes
1answer
24 views

add_media_page function not creating submenu

I have the following plugin that I'm just testing at the moment. /* Plugin Name: Menu Test Plugin URI: http://codex.wordpress.org/Adding_Administration_Menus Description: Menu Test Author: Codex ...
0
votes
1answer
38 views

nav_menu: how to force a subpage switching on the parent menu

I've been using the native wp_nav_menu to output my navigational elements. I have also created a subpage that is nested under one of my menu, but when I hit that URL the default custom walker clearly ...
0
votes
0answers
76 views

Custom Menu echo own HTML

I've registered a custom menu and got all that set up, however the formatting of the HTML that the menu uses doesn't fit with the CSS/HTML menus I had previously and want to keep. Therefore I was ...
1
vote
0answers
34 views

using OOP approach to create plugin but stuck at making hyperlinks to work

I am new to wordpress development so please be patient if my question sounds simple or ridiculous, since I have been doing object oriented programming in PHP so i wanted to use the OOP approach in ...
0
votes
0answers
134 views

Custom wp_bootstrap_navwalker file

I got a little problem right here. So I installed the wp_bootstrap_navwalker and it works so far. I got a 3 stage Navigation. The problem is that the navwalker adds the dropdown-menu class to every ...
3
votes
1answer
295 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
7k views

How do I remove UL on wp_nav_menu?

I search on this site and found many answers for this question. Most of them is not working on my theme. Here is a one solution I found and it's working according to my need. function ...
0
votes
1answer
24 views

Why is only the first operation run in my loop - except for on the last repeat? [closed]

We have a custom walker displaying only the sub menu of the current top menu and while making some changes to it I ran into something I don't get - for some reason only the first echo of each loop in ...
0
votes
0answers
36 views

Problem with custom menu links when moving wordpress installation to subdirectory

I know there's a ton of posts pertaining to broken links after migrating a wordpress installation, but I haven't been able to find an exact solution to this one. A site I'm working on has the ...
-1
votes
1answer
42 views

Add monthly archives menu and submenu

I'm posting this question because I was trying to look for an answer but couldn't find it. I found the answer myself with the help of this answer and I wanted to share it with everybody that would ...
0
votes
1answer
224 views

Auto Filled Custom Menus for Custom Post Types?

Is there anyway to have custom menus that fill out automatically, specifically for custom post types? You can do it for default pages but nothing else it seems... For example you have a page which ...
2
votes
1answer
95 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 ...
0
votes
0answers
20 views

Output only the 3rd level of menu

Currently I use wp_nav_menu to output the first and second level of the menu in the header of the page. However the menus have more depth than that and I need the third level to be shown at a ...
0
votes
1answer
30 views

Add link at the end of wp_nav_menu

I need to add a conditional menu item such as "/at" or "/de" or "/ch" in the wp_nav_menu. Since the link is conditional (based on the country the website is being viewed), it can't be added from the ...
0
votes
1answer
171 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
45 views

How to get current menu item “CSS Classes” value?

While on any given link that has a CSS Classes value, I'd like to do something like this: $css_classes = get_current_menu_item_css_classes(); if ( $css_classes == 'mycustomclass' ) : // do ...
0
votes
2answers
65 views

How to get main menu only with wp_nav_menu

I have created one menu and have some sub-menu but I don't want to display any sub-menu from my template. My Menu code: <?php wp_nav_menu( array('menu' => 'header-uk', 'menu_id' => 'nav', ...
1
vote
1answer
1k views

Add custom menu item using wp_nav_menu_items filter

I have added a snippet to add a "Profile" link to my website navigation menu. My code: add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link'); function my_nav_menu_profile_link($menu) { ...
1
vote
2answers
57 views

Detecting classes, adding widgets, and adding divs in with a Nav Walker

I've been trying to figure this out for days, to no avail. A template I'm building requires a mega menu. The markup for the menu looks like this: <nav> <ul> <li><a ...
1
vote
1answer
33 views

How should I build a custom menu walker for this setup?

I have a menu structure I built in HTML+CSS that I would like to incorporate into a WordPress menu, but I am new to extending the Walker class and was wondering if someone could show me an example of ...
1
vote
1answer
119 views

Set if condition with wp_nav_menu

I have created one new menu and add bellow code in footer.php to display my menu wp_nav_menu( array('menu' => 'footer-cn', 'menu_id' => 'nav', 'menu_class' => 'ft-nav' )); Currently I did ...
0
votes
0answers
27 views

Duplicate WP3.0 menu php files?

He's my problem: I want to have a single page that a WP-admin can build by including different parts of the site by choosing posts. (I know the admin could add these posts to a category and then ...
0
votes
0answers
50 views

Conditions for single post

I want to add current-page-anchestor when a single post is browsed. I was looking for that function code and tried many, but with not success yet. Now I am thinking I can do it that way, then it would ...
0
votes
0answers
116 views

Keep active class in post page

I have one category and under this category I have many posts. Normally when I go to my category page from menu it added active class class="current-menu-item". Bellow is the rendered html <ul ...
0
votes
1answer
29 views

How can I pass value to function in add_menu_page?

I was use to pass value to function for the below menu. add_menu_page('Competition Manager 2013-2014', '2013-2014', 'manage_options', 'manager_2013_2014', 'manager_2013_2014', plugins_url( ...
-1
votes
1answer
67 views

How To Add Class To Style Search Box

I am not very experienced with PHP but have managed to find a snippet to add a search bar to my main menu, using this code in my functions.php file: add_filter( 'wp_nav_menu_items','add_search_box', ...