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 (6)

0
votes
1answer
20 views

How to get submenu of admin menu?

I user global $menu in one of my plugins to get the list of menu items. But i would like to get the list of of items from a submenu for example from Posts i would like to get Add new, All, Edit ...
0
votes
2answers
32 views

Admin page and admin menu. Permissions plugin

I was googlin really hard but couldn't find any answers. What i'm trying to do is write a simple permission admin page plugin. So far what i did a page with every role where i can check a certain ...
-1
votes
2answers
76 views

Wordpress Add javascript:void(0); to menu link item?

I want to add javascript:void(0); to menu link item instead of # but it is not accepting any JavaScript. Now i am thing to replace # with javascript:void(0); using filters, but could not find the ...
0
votes
0answers
27 views

Missing automatic default pages menu in twenty sixteen theme

i don't know if this is a bug or a feature in twenty sixteen theme (it also happens in twenty fifteen). In a completely new installation, wp 4.5.2, just after created 3 test pages, if I activate ...
0
votes
0answers
13 views

Change name of links in menus automatically when title of page changes

I have created a menu (Appearance -> Menus) and placed desired pages I want to have there as links. I did that for multiple languages, and I also have a few other menus for footer and sidebar. In the ...
3
votes
1answer
76 views

Making Wordpress' page and menus visible only for logged in users, checking session variables

I'm trying to login users in wordpress through an API of another platform, so what I do is use an ajax function to call an external API sending the user credentials (username, password) and getting ...
0
votes
0answers
19 views

get_pages() shows either ALL pages or just main-menu

I'm losing the battle with get_pages(). What I'd like is a list of child pages to display on each main-menu parent page. I'm trying get_pages() rather than wp_list_pages() as I'd like to be able to ...
0
votes
1answer
55 views

How to add aria role and schema markup to custom walker container

Edit: after doing some research I've found that in the wp_nav_menu function uses the following code to display the containers value. if ( $args->container ) { /** * Filter the list of ...
3
votes
1answer
38 views

Pass a parameter to a menu walker

Is there any way to pass a parameter to a menu walker? I'm trying to write a BEM-style walker, and I'd like to be able to pass a class to apply to the menu links via the walker. Something like: <?...
0
votes
0answers
15 views

Highlighting correct path with Wordpress Nav_Menu function

I have created a WordPress site for a client, in which you filter through the navigation menu (set-up in appearance->menu) by revealing hidden items (unordered lists with class "sub-menu (generated ...
0
votes
0answers
15 views

Remove/Disable “Automatically add new top-level pages to this menu”

Is there any way to disable or remove the "Auto add pages - Automatically add new top-level pages to this menu" functionality via a theme? I suppose I could hide it with a bit of CSS, but I'd rather ...
1
vote
1answer
42 views

How to display submenus on page based on referring top-level parent?

I am trying to display a secondary menu on pages that displays all the coordinating sub-pages of the top-level menu item they navigated there from, but my issue is that some pages appear under ...
0
votes
1answer
31 views

Outputting Page Title As Tooltip

I'm trying to output the page title via wp_nav_menu() as a tooltip (.pop_up). The menu text has been replaced by an icon, and using CSS to hide it. Any ideas how this could be adapted to output the ...
0
votes
0answers
7 views

submenu item under other top level menu and change some fields

I would like to add the 'Add new' user submenu to have a different name(in the menu) and under a custom top level menu that I created. I have removed most of the standard admin menu and replaced it ...
0
votes
1answer
29 views

functions.php adding item to end of menu. I want to change position

I found a function in my template that is adding a register button to the end of my menu. I'm wondering if there is any way to make this function add the register button to the beginning of my menu ...
0
votes
0answers
21 views

Menu Item Post variable count way too high, can't save menus

I'm having trouble saving WP menu items and I've done all the usual things as documented here: http://sevenspark.com/wordpress/menu-item-limit and here: Menu Items Disappearing And I know that the ...
0
votes
0answers
8 views

Set rules for file uploads to dynamically hide/show menu items

I am curious if anyone has a clue about this? Upload a file. If file meets certain criteria, link the file dynamically to a menu item If file is linked, the menu item will show. Until an associated ...
0
votes
0answers
44 views

Foundation 6 Dropdown Menu & WordPress

I'm trying to incorporate the foundation 6 dropdown menu with WordPress's menu. WordPress currently outputs <ul id="menu-menu-1" class="menu"> <li id="menu-item-24" class="menu-item ...
0
votes
2answers
34 views

Adding 'Original' URL for Custom links

I have a menu with custom links with the section of URL, however if I want to change the URL(to remove it) for some page(Sample Page) I can not, because I must provide specific URL. I want to put '...
1
vote
2answers
60 views

Partial refresh of menu in customizer not working?

WordPress 4.5 supposedly enables live refresh of the menu in the customizer, though I cannot get it to work. If I reorder the menu (in customizer) I see no changes until I perform a manual refresh. ...
0
votes
1answer
17 views

How to add columns to wordpress menu editor

Wondering if someone can point me in the right direction. Currently, I'm trying to figure out how to add columns and headings to sub menus. Naturally I want to create a basic megamenu where I can add ...
0
votes
2answers
27 views

How to request container_class from wp_nav_menu

I'm currently trying to setup a custom nav walker that will use container_class from the menu as a prefix for the class names of the list items and children. $defaults = array( 'menu' =>...
0
votes
1answer
25 views

How to separate sub-menu output and keep associated with parent

I am creating a menu like this https://squareup.com/ I have the html,css, and jquery ready. Now, I am trying to: Create the menu items with it's sub-menu items via wp-admin -> appearance -> ...
0
votes
1answer
38 views

All custom links suddenly lack href attributes

Short version: before updating to WP 4.5 and on a day when the only known change was adding a page to a submenu via the navigation menu admin all of the menu links of type Custom Link where we specify ...
3
votes
1answer
27 views

Set blog archive to active when browsing archive

I have a link to my blog archive in my main menu. When the user clicks it and the blog is displayed (on /blog/ - I have a static front-page) the link receives the "current" class (or whatever the name ...
0
votes
1answer
24 views

Custom menu with Walker class - what should the $db_fields be?

I'm trying to create my own custom menu using the Walker class and in the process of trying to figure out what's going on, I'm attempting to reproduce what wp_nav_menu() does by default, so, I've got ...
0
votes
0answers
25 views

Addressing Child Page from Custom Menu

I build the website of an association with centers in different cities. Each city's pages need their own sidebar. I want to program an automated solution where the editors dont need to select anything....
1
vote
1answer
39 views

Add div to specific sub-menu

I researched in google, yandex but had no success. With this code I can set a div to sub-menu but this code add to all sub-menus, I just need to add div to specific sub-menu. class Megratron_div ...
0
votes
1answer
34 views

How to add an attribute data-slug = “$specfic_page_slug” in WordPress menu item?

I want to add custom attribute in WordPress menu item which has specific page slug. like this - <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-101" id="menu-item-...
1
vote
3answers
140 views

Menu item added in wp_nav_menu_items filter is never highlighted

In a Twenty Thirteen child theme I append a menu item (a link to /player-number page template, where the number is different for each user and represents her or his id in a game database) using the ...
0
votes
1answer
34 views

How to create and populate with few links a menu in child theme functions.php?

The official Twenty Thirteen theme defines just a single menu in the /wp-content/themes/twentythirteen/header.php file: <?php wp_nav_menu( array( 'theme_location' => 'primary', '...
0
votes
0answers
22 views

Why is error shown twice? (how to apply menuitem to menu correctly?)

Starting to create a plugin that adds content and hooks that content into a menu (in this case below I started to add a search-functionality to hook into menu just for testing) if( !class_exists('...
1
vote
1answer
24 views

how to disable default menu classes

i want to disable default menu class, bellow code is disable menu class completely. add_theme_support( 'menus' ); add_filter('nav_menu_css_class', 'my_css_attributes_filter', 10, 1); add_filter('...
-2
votes
1answer
26 views

Jquery dropdown menus working locally, but not in Wordpress [duplicate]

So I've followed this tutorial to the T, even downloading source files and implementing locally: http://red-team-design.com/simple-and-effective-dropdown-login-box/ I also saw another poster here ...
1
vote
1answer
58 views

How to add #navbar to all page links?

I have several Wordpress websites with large images at their tops, using 2013 child theme. How to add #navbar anchor to all page links, so that the browser scrolls down a bit, when a user clicks a ...
0
votes
0answers
22 views

Prevent unassigned menu position from showing all pages

This seems like a common enough problem. Perhaps I am using the wrong wording in my search... My theme supports 2 menu positions. I only need 1 menu, so I have assigned it to the vertical position. ...
0
votes
2answers
29 views

How can I use custom menus with a Bootstrap WordPress theme?

I have this 'primary' menu with a few items in the CMS, which I can list nicely with this PHP code: $args = array( 'theme_location' => 'primary' ); wp_nav_menu( $args ); The PHP outputs ...
1
vote
2answers
47 views

How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()

I want to add custom classes to my menu items. For every subpage I show its siblings as a navigation: global $post; if ( is_page() && $post->post_parent ) { $...
0
votes
1answer
21 views

Users are required to login to my site. How define user.member boolean, its permissions, and conditionally display/handle behavior based on it

Users are required to login to my site. They are redirected to the login page and not allowed past the login page until they authenticate. Once authenticated, they can access most of the website. ...
-1
votes
1answer
38 views

Elegant way of adding an CTA to a menu

I'm new to WP and looking to put a Call To Action (CTA) to my main menu. Currently the ordinary items are left aligned, and the CTA would be right aligned. So far this is what I've thought: Hardcode ...
0
votes
1answer
17 views

Change link in menu on condition

I have website, where I want to change link in menu, if I'm on this page, example: On frontpage link in menu is: http://example.com/#blog On blog page link in menu is: http://example.com/blog Is it ...
0
votes
0answers
17 views

How to Use Default Auto-Generated Menu?

I have a site with a decent number of pages (130+) and it is organized using the Parent functionality of each post. This works well. I'm trying to use a mega menu plugin, but it wants me to select a ...
0
votes
1answer
39 views

Editing existing pre-created menus in PHP

Here's my pickle. I'm using a script to automatically create a fully pledged WordPress site. In this process new pages, etc are created automatically. I now need a way to add the newly created page(s) ...
-2
votes
3answers
47 views

Wrapping my <li>'s with <a>

Whats the most simple way to change my wp-menu generated output from <li><a href="">nav link</a></li> to <a href=""><li><li/></a>? Do I create an array ...
3
votes
1answer
42 views

Some nav-menu filters do nothing

So, I've been trying to write a plugin, and I need to use the 'nav_menu_link_attributes' filter. I tried adding the filter, but it didn't respond - at all. That is, I made it die mid-process once the ...
0
votes
0answers
38 views

Query/load only WooCommerce shop categories into a custom landing page?

I want to reuse the WooCommerce shop-categories in a custom grid landing page, but without the product images, as I am using custom images to make the grid wall. What is the best way to do this? ...
0
votes
1answer
99 views

Keeping my Sub Menu open when hovering on its list items

I'm building a custom theme from scratch and I'm stuck on this dropdown styling. I am able to have the sub-menu appear when its containing <li> is hovered but when I go to transition my mouse ...
0
votes
0answers
15 views

Customer nav menu walker for post type and taxonomy archives

Walkers have the least documentation that I'm able to find, so I've come here to ask how to achieve placing items attached to categories as sub-menus. Let me explain: I have a simple menu that ...
0
votes
1answer
67 views

Assign different category colours to different categories in the main menu

I have created a colour picker field with ACF which shows on every category page and allows the end user to assign a colour to each category. This is working well but I would like the categories on my ...