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
0answers
30 views

automatically add custom taxonomy items into menu

I wish custom taxonomy items to appear in menu automatically. Currently I have custom post type with custom taxonomy. function ales_create_post_types() { register_post_type( 'ales_product', ...
1
vote
3answers
148 views

On which hook should I be calling register_nav_menu(s)?

I've variously seen register_nav_menus() called: on after_setup_theme on init pasted "loose" into functions.php with no apparent change in functionality. Which hook should I be using to call this ...
0
votes
1answer
45 views

how to insert data in li tag of navigation

I'm trying to insert an image for each of my navigation items without any plugins. I'm not much of a coder, but I googled for something called walker, but not sure if this should be done for my case. ...
0
votes
1answer
70 views

Adding Additional Variables on Menus Page

I'm learning PHP by building a plugin to show or hide menu items based on a user's location. I am a bit stuck at the moment. In the function below, the text input is being saved to the database, but ...
0
votes
0answers
9 views

Query Code Making Menu Disappear

I'm trying to display only certain tags on my site, but when I use the code my menu disapears. Heres what I have: $query->set('tag', 'break','crunch'); return $query; I have this placed in the ...
0
votes
1answer
50 views

switch_to_blog() and wp_nav_menu() not functioning properly

I have an MU plugin active on the network with this small function to query menu 4 from the main site in my network. On the main site in the network (1) things work as expected. On the sub sites in ...
0
votes
1answer
36 views

WordPress menu>Custom Link: removing my link formatting and adding %20

I am pasting this url: <a href="#" id="event_inquiryToggle">TEST</a> into WordPress Custom Link menu item. When I hit save it saves it as such: http://a%20href=#%20id=...
0
votes
0answers
302 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
165 views

How to add number of post to category menu items

I wanted to know how we can add number of posts for dropdown menu items that are categories. For example: Topics Category 1 (5) Category 2 (8) Category 3 (2) More Topics Category 1 (5) ...
0
votes
1answer
763 views

Dropdown menu on click change

Im working on a website where I need to create a submenu that shows only the parent pages. When I click on one of the parents it has to show the children from that parent. Here is the menu hierarchy ...
-1
votes
1answer
82 views

How to make posts appear under pages

I have created pages for my website, however when i create a new post, it is not assigned to any page and i am missing the option to place it under a certain page. For example i have a menu like Home ...
0
votes
1answer
101 views

New walker for walker_nav_menu to change inside container data

I'm not really good with coding, but I have googled a lot and edit some script and it worked, but I can't achieve what I need. This is the code: class description_walker extends Walker_Nav_Menu { ...
0
votes
1answer
119 views

Loop through Navbar, Output Icons

I'm trying to loop through my Navbar in WordPress so that I can output some Icons at the end of the last link. I have this working but I end up outputting a Navbar and a list. I think this is because ...
0
votes
2answers
4k views

Creating a custom menu/widget area

I'm looking to create a /menu/widget area like the following site: http://www.microsoft.com/en-gb/default.aspx please see sections under downloads, security, support, about is this considered a ...
0
votes
2answers
130 views

How to Add <span> to Each Menu Link with link text to data-attr?

how do i get something like below my code is like this. wp_nav_menu( array( 'theme_location' => 'header_menu', 'container_id' => 'menu', 'link_before' => '<span ...
0
votes
0answers
36 views

Javascript in WordPress Navigation - mobile menu

I added a Live Chat link to my WordPress navigation menu. I followed the Ideal solution #2 below which works great on the desktop, but not on the mobile menu. It doesn't do anything on mobile. Any ...
-1
votes
2answers
45 views

My Menu Disappears on my Custom Link Homepage on Mobile

My menu on my custom link homepage disappears on mobile, or when the window is small on web browsing. The thing is on all my other pages on mobile, the menu is there in the form of three lines - as a ...
0
votes
1answer
605 views

Dynamically get the meta key value of a menu item based on it's post ID

I have a menu, that I need to insert an image that have it's path saved in a meta key (_menu_item_img) and associated with a post ID, every menu entry has it's own image, and I need to grab it ...
0
votes
1answer
72 views

How to undo the last changes to a custom menu?

I have a wordpress site with a custom menu. When I want to add a page or something to the menu, I click appearance, add the item, then drag it to the right location. This time when I did it the menu ...
1
vote
2answers
66 views

How to add a parameter to <a> links in the nav menu?

I have to add itemprop="url" to the links of the links in the navbar of this site. In the settings I found the function wp_nav_menu(). Even after reading the WP codex, I am not able to make the ...
0
votes
0answers
54 views

Cannot get custom links to show using wp_get_nav_menu_items

$args = array( 'post_type' => 'nav_menu_item', 'post_parent' => $id, 'orderdby'=> 'menu_order', 'output' => ARRAY_A ); $childs = wp_get_nav_menu_items( 4, $args ); ...
67
votes
4answers
74k views

Menu items description? Custom Walker for wp_nav_menu()

Normal Wordpress Menu looks like: Home | Blog | About us | Contact But I've seen many pages with descriptions under these links: Home Page | Our Blogs | About us | ...
0
votes
0answers
45 views

How to add custom pages to menu programmatically?

So I need to add some pages when it created to the menu within plugin. Menu id is 125. Pages have taxonomy gp_hubs. $category = wp_insert_term($name, 'gp_hubs'); foreach ($sub_categories as $sub_cat)...
4
votes
1answer
248 views

Add class to top level menu item if it has multiple child levels

I have a WP nav menu, and I need to add a class to any top-level <li> if that item has more than one level of child items (meaning, its child submenu has a submenu too). Like this: <ul> ...
1
vote
2answers
42 views

Declaring <?php ?> in variables [closed]

I need to put the PHP <?php global $' . $icon_var . '; echo $' . $icon_var . '; ?> inside the variable of a custom menu structure, but it gets commented: <a href="http://slembas.esy.es/">...
0
votes
0answers
62 views

Display page content with Boostrap modal from the menu

Been searching for a solution but I'm not finding one or I'm getting confused. My goal is to be able to create a page in WordPress, enter the content and add the page to the Pages Panel under Menus ...
1
vote
2answers
1k views

Get WP Navigation Menu from REST API V2

I'm trying to get the navigation menu from JSON response using WP REST API v2 plugin. There is no navigation menu plugin extension for the REST API v2, but only for V1. From codex WordPress Post ...
0
votes
0answers
16 views

How to keep state of custom menu?

<div class="menu-main-container"> <ul id="menu-main" class="menu"> <li id="menu-item-1"> <a href="/category-a/">Category A</a> <ul class="sub-menu"> ...
1
vote
0answers
29 views

Menu items suddenly are displayed all over the page [closed]

Strange things are happening :( When you take a look at the site: www.handelbijvanandel.nl you will see that all menu- and submenu items are shown on the page. At first I didn't pay much attention to ...
1
vote
0answers
82 views

Main Menu and Sub Menu Items for Footer

So I'm currently trying to figure out how to display both my main menu items and my submenu items separately in my footer. I want to display them both in separate columns (bootstrap) and am having ...
1
vote
0answers
46 views

WordPress Quick Question . How to Get Parent Link in Submenu in My Code

I'm creating a menu walker from foundation 6 but problem is parent link is not click able, so solution might be that if we can get parent link in submenu but have some problem because I'm don't know ...
1
vote
1answer
20 views

How to override the theme home page?

I'm using a theme that has it's own home page layout but I want to use a normal page instead. I can't find a way to change it because in Settings> Reading, the home page is already set to 'Home' (a ...
1
vote
0answers
20 views

'Pages' widget alternative for custom post types?

I want to make a menu from hierarchical custom post type. There is a default WordPress widget called 'Pages' that give you list of all the pages preserving their hierarchy. Is the a way to use this ...
1
vote
0answers
30 views

custom walker class

I'm trying to make a navigation that has a similar structure of this website: https://grannys.ca/ But I got struck in the logic of how can I implement an if statements which determine several things: ...
1
vote
0answers
15 views

Menus don't work after 4.4

After I updated to Wordpress 4.4, I noticed that the menu links on the front page of my website don’t work anymore. The website is: http://rantaboutfilm.com/ the theme is: swagger When the user ...
1
vote
0answers
18 views

Sub menu indicator that links to sub menu

I am trying to create a custom mobile menu for my wordpress site. I have looked around the net for an answer and found similar things or different ways that I can accomplish this but not in the way ...
1
vote
0answers
41 views

Custom navigation structure with walker class

I'm trying to make the navigation with different structures using walker class but I got stuck. Here's the code of what should the html output <nav class="main-nav"> <div class="...
1
vote
1answer
273 views

add span class and i tag inside wp_nav_menu link anchor tag

I found examples adding a class to top level items, so we can display an arrow in menu items with sub-items, but is seems terrible to cope with the already built in WordPress classes, can't display ...
1
vote
0answers
67 views

Uber menu, manual integration, disable Mobile

i use uber menu plugin for my theme. my theme (pointfinder) require manual integration code.It works perfectly, but I would turn it off completely on the mobile I used the following form (if else)to ...
1
vote
1answer
15 views

Different fields available for different sites when when customising Menu's

I have 2x websites, both running identical versions of the same theme, yet when I try to customise the menu's I'm met with different field options. On Site A I am able to add settings to fields such ...
1
vote
1answer
67 views

get_query_var('post_type') not returning in a filter

Trying to highlight custom taxonomy pages in the main nav, so I am trying to get the post_type of the current rendered page (to compare to the menu item): add_filter('nav_menu_css_class', '...
1
vote
1answer
14 views

Hide sub menus sometimes

I have the following css: nav ul ul { display: none; } It hides sub-menus for me. It works too well. I'd like the sub-menu to be visible iff the parent menu item is the parent of the selected ...
1
vote
1answer
20 views

category permalinks

i am quite confused about the permalink stuff. So here is whats up... I have a page called tours as well as custom post type called mc_tours. At first i just changed page permalink to mydomain/...
1
vote
0answers
18 views

Creating a menu containing categories and authors

I'm looking for a way to make a menu that contains all categories and when an author has 1 or more post in said category they appear in the dropdown for that category, the links could look like this: ...
2
votes
2answers
2k views

Assign Menus to Theme Locations with theme activation

A site is using "child1" named child theme. When this site switches to other child theme named "child2", their widgets are moving too but theme locations are not moving. How can i auto assign menus to ...
1
vote
0answers
25 views

Responsive menu gone on wordpress Responsive theme

The responsive menu on my website is gone (homepage only). I am not sure what caused that and don't know how to fix it. Can you please help? I will really appreciate it. The website is http://www....
1
vote
1answer
31 views

I am facing a problem with the navigation menu of my website

The link to my website is http://ashevilleandbeyond.com/ and when you load it on your browser, for a few initial loading seconds, you will notice that the menu items are visible at the top left side ...
1
vote
0answers
51 views

Create menu / submenu from category subcategory and posts

I have a custom menu made up of pages and categories and I am trying to output the category and subcategories as well as the last 4 posts from each category/ subcategory. In trying to use a walker ...
0
votes
0answers
55 views

Add each Wordpress menu item into individual Bootstrap column

So basically what I'm trying to do is create a custom menu that has icons the user can add/edit. Each menu item has two pieces to it, the top has an icon and then the base has the name of the button/...
1
vote
0answers
78 views

Custom Loop through category menu to include sub categories

In my custom wordpress theme I currently have the below loop to the main categories <?php $menu = wp_get_nav_menu_object('navigation'); $items = wp_get_nav_menu_items($menu->term_id); foreach($...