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
2answers
84 views

Wordpress Split Menu

I'm coding my first WordPress Theme and trying to solve this problem: On the desktop version of the website I’d like to split the menu into 2 sections. One would appear on the left of the logo and ...
0
votes
1answer
38 views

Horizontal Navigation

Hi. I been fighting with this problem for couple of weeks now. Trying various approaches. From CSS styling to a custom walker. I want to render each level as its own element. The navigation ...
4
votes
4answers
4k views

wp_nav_menu: show menu only if one exists, otherwise show nothing

I'm trying to use wp_nav_menu to only display a menu if one exists, otherwise, display nothing. If I delete the menu, it will output a list of the pages. My functions.php file contains: if ...
0
votes
1answer
41 views

Category menu that filters out empty categories

I'm trying to build a menu which can be administered from the menu editor, but gets filtered before being output. More specifically the menu contains Woocommerce product categories, organised into a ...
0
votes
0answers
21 views

How to hook new args into a Custom Menu Widget?

I am trying to add some code before the list items in a sidebar Custom Menu Widget. Maybe I'll add an image, maybe I'll add some text. Not sure yet. But I'm having a hard time trying to figure it ...
0
votes
0answers
26 views

Menu not saving in dashboard

I've created menus in wordpress dashboard countless times and never had a problem saving them until today. Getting this error: "The menu name Main Menu conflicts with another menu name. Please try ...
2
votes
1answer
774 views

How to register custom menu widget

I'm trying to register a custom menu widget programmatically with wp_register_sidebar_widget, but it doesn't appear in wordpress. I'm using remote call of that method (xml-rpc). Referring to codex I'm ...
1
vote
1answer
157 views

Change an li class name in a wordpress custom menu walker

I'm building a nav that has a class applied to the main LI's and the nested LI's. Example: <ul> <li class="className">Test</li> <li class="className">Test <ul> ...
4
votes
1answer
208 views

wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = ...
2
votes
0answers
119 views

All Menu Items Disappear Seemingly at Random [duplicate]

For the last month or so, seemingly at random and with no discernible pattern, my menu disappears. However, when I look at the Dashboard, what I find is that all the menu items have been deleted but ...
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
27 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
16 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
41 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
21 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
41 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
31 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
26 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
900 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
137 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
41 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
82 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
85 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
356 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
31 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
119 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
18 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
34 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
65 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
110 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
289 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
32 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
36 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
222 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
77 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
18 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
27 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
112 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
42 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 ...