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
38 views

Menu Details Output in Javascript [closed]

I have to output page, parameters( Page Url, Page Name, and Page's featured image) in javascript loop, one by one I think we can display it through NavMenuItems or NavMenu functions Pages displayed ...
2
votes
4answers
770 views

Adding first and last class to Menu on top level only

I'm using a WordPress Menu to create a navigation structured like this: Home About Contact Sub Page Using this code from kuroi's response here I'm able to add first-menu-item and last-menu-item ...
0
votes
0answers
22 views

display menu depending on selection on homepage

Like I wrote in the topic On my homepage there are two links: business and consumer depending which link I choose I want to display a certain get_template_part (menu) So If you click on "business" ...
0
votes
1answer
39 views

Hide menu from homepage

I am using the WP- Spirit 01 theme and would like to know how can I hide the navigation menu ONLY from the website homepage. I don't have my website live yet. The css code bellow works to hide the ...
0
votes
1answer
56 views

How can I make wp_nav_menu() support <br> tags?

Static webpage created nav menu separating titles using <br> tags, but when I'm converting the site into WordPress I'm missing <br> tags there. How can I enable using <br> tags in ...
0
votes
1answer
184 views

Show different menu on each woocommerce category page

I have created several custom menus that appear under the main menu on the shop page. Each category (and its subcategories) should display a different custom menu like below: custom menu: ...
0
votes
0answers
15 views

Customize navigation menu in the Twenty Fifteen theme

Is it possible to change the behavior of the navigation menu in the Twenty Fifteen theme so when a user clicks a menu item to open a submenu all the other already opened submenus are closed? I'm ...
2
votes
1answer
695 views

Adding Custom Taxonomy Archive Link to Nav Menu Shows Up As (Invalid)

I have a custom post type "packages" with a taxonomy "Celebrations" that has a few terms in it. When I try to add a link to my wp nav menu through Appearance > Menus and choosing the term I want from ...
1
vote
1answer
15 views

Menu / div of year and months of blog posts?

I want a menu or a dive with this content where you can click on and see the blog posts from the selected date that is like this BLOG -2014 -january -february -march -.... -2013 ...
2
votes
2answers
832 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
0answers
30 views

Decrease vertical space between dropdown items w/o changing menu height?

Trying to decrease the vertical space between menu items in a list styled as a dropdown menu but having trouble doing it w/o decreasing height of navbar. To see current setup, click here and wait a ...
0
votes
2answers
59 views

How to add bubble count in WordPress wp_nav_menu menu?

I have to add a bubble notification in WordPress wp_nav_menu like the following code. <ul> <li> Tickets <span class="unread">2</span></li> ...
0
votes
1answer
66 views

Add data-id attribute to child page links

The should be simple but I just can't figure it out nor find an answer. I need to add a data-id attribute to the <li> parent container of the respective child page <a> links. The HTML is ...
1
vote
1answer
90 views

How to replace the page url for the page slug in a menu link?

I am developing a single page site within WordPress, that contains multiple sections. These sections are pages in WordPress. In my index.php I loop through all pages within WordPress and add them to ...
1
vote
1answer
56 views

Add a class to the body tag when a menu is enabled

Question edited How can I add a class to the body when the menu at the menu setting > theme locations is selected. Like in this screenshot: And if I have two menus, can it add two different ...
0
votes
1answer
6k 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. ...
3
votes
3answers
12k views

Show just one level of child pages, wp_list_pages woe

I'm working on a site that has a fairly large page structure a few levels deep - in some sections there are a lot of pages. The basic setup is something like this... Parent Parent Parent -Child ...
0
votes
1answer
33 views

Make menu structure match page heirarchy on page parent change

Old WordPress themes like twentyten contained functionality which allowed nav menu structure to reflect changes in page heirarchy. For example, if I have the arbitrary page heirarchy (and matching ...
0
votes
0answers
32 views

How to create a custom walker class to replace the href with hashtag slug?

I was wondering how I can achieve the possibility to replace the default WordPress menu links with #slugname. How should a simple walker class should look like to achieve this? I came up with this: ...
0
votes
1answer
80 views

How to exclude pages in the menu without pageID?

I am creating a single page site, that contains multiple sections. These sections are pages within WordPress. I use the following loop to get all pages in index.php file. <?php $args = ...
0
votes
1answer
105 views

Adding Custom “Current Menu Item” class to navigation?

I'm using the following code to force my wordpress navigation to reflect the category of the current post. It works perfectly, but I need help to extend this function to more than just 1 category ...
0
votes
1answer
166 views

Counting top level items in a custom menu walker

I am creating a split menu (half the items on the left, logo in the middle, remaining items on the right). I don't really understand Walkers all that well, but I found this code snippet. This was ...
1
vote
2answers
59 views

Two different menus for two different locations?

I'm trying to change the menu in a primary and a secondary menu depending on the page which is visited. My primary menu is in the top of the page, and it looks like this: Index | About | Contact ...
5
votes
5answers
11k 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
0answers
36 views

Move WooCommerce menus to submenu settings

i'm searching a function that will move my woocommerce dashbord menu items (Products, WooCommerce) to wordpres submenu: settings I try to remove menus and add them again using: add_action( ...
0
votes
0answers
18 views

Custom menu problem

I have following menu coded under header.php and i want to add an page under a category menu as an example instead of 36 (category id) i want to display the page id 8197 P.S. i tried to remove the ...
2
votes
1answer
131 views

Creating new menu item

I'm looking for a way to create a new item that can be added to a menu. Here are the details of my problem: I use WPML. WPML have that nice feature that you can add the switcher to a menu, ...
0
votes
0answers
22 views

Function for moving a sub menu under a different top level menu?

I have a snippet that will allow me to make submenus become top level menus, but can you help with a snippet that will allow to move a submenu to be the submenu of a different top level menu? For ...
16
votes
5answers
18k views

Add 'has_children' class to parent li when modifying Walker_Nav_Menu

I'm writing a customised walker class for wp_nav_menu and want to be able to specify if an li contains a submenu. So I want my markup to be: <li class="has_children [other-wordpress-classes]"> ...
0
votes
0answers
15 views

Is using categories for site structure a bad solution

I've been thinking about a current site structure implementation that relies on categories to build out the menu structure and the category template to render site content. As categories can change ...
3
votes
3answers
13k views

How to add a data attribute to a WordPress menu item

I'm Twitter Bootstrap and need to add data-toggle="modal" attribute to the a tag of menu link. Upon searching most all results reference doing a walking for Twitter Bootstrap dropdown menus however ...
2
votes
1answer
8k views

Add class to active element and its parent in nav menu

I am using the following code in order to add a class name "active" to the current menu item: add_filter('nav_menu_css_class', 'add_active_class', 10, 2 ); function add_active_class($classes, $item) ...
0
votes
1answer
19 views

Mark a page of a queried menu as active

Im trying to mark as active a page of a queried menu --> (I found the answer) function render_main_menu(){ $args = array( 'post_type' => 'a_cpt', 'tax_query' => array( ...
0
votes
1answer
569 views

Admin Menu Hack (Left side in Dashboard)

How can I add a Title to my Admin Menu on the left side of the dashboard? Not a link, but just a title? I want do this in my functions and not use a plugin. Also which template file handles this menu? ...
1
vote
1answer
70 views

Check if a menu is empty?

I have menus set corresponding to a custom field on a page. Ie I have menu1, menu2, and menu3 on three pages under custom field => MenuName. Under functions.php I have: /* Add Menu Locations */ ...
1
vote
1answer
2k 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> ...
0
votes
0answers
6 views

How do subpages work in Wordpress and are they affected by custom post types vs pages?

I've got a landing page that covers an overview of a company's offerings. There are then subpages that detail different types of offerings (this may be something that the user can add more of). I ...
0
votes
1answer
32 views

How to add a toggle on the left side of my page?

How to add a toggle on the left side of my page and the content on the right side of my wordpress page. The toggle should behave like a menu on the left side(the arrangement)and each heading would ...
0
votes
0answers
67 views

Custom walker menu , add class link before

I'm trying to implement a responsive jQuery navigation but I need to extend the default output of the WP menu. I believe I need to use a custom walker but honestly, I don't know how to get it to work ...
0
votes
0answers
16 views

Add menu section and items to the Appearance > Menus page

I am writing a plugin that creates some virtual pages according to How do you create a "virtual" page in WordPress. I want to be able to add these virtual pages as options in the Appearance ...
0
votes
0answers
27 views

Custom nav menu current item custom link problem

Because I want to add <span class="dashicons [class]"></span> inside each link of my menu I needed to create a custom made nav menu. I did this by the code below which works great, but ...
0
votes
0answers
28 views

working with wordpress theme

I am trying to create a wordpress theme, actually I am very new to wrodpress theme and plugin and currently learning wordpress theme, so I have a html design with me and I am trying to convert it to ...
0
votes
1answer
32 views

is_page() not working with archives?

I am creating a dynamic menu and in my foreach loop I am running a is_page using the page title: <li class="<?= (is_page($tlp->post_title) ? 'active' : '');?>"> </li> This ...
0
votes
1answer
72 views

Adding archive years to my menu

I'm Wordpress newbie and despite of reading many articles, I'm able to put archive years to my main menu. Menu contains pages and I need to add an archive. My current menu: - Home (page) - About ...
0
votes
1answer
29 views

Menu not appearing in custom theme

I made a custom theme, but the menu is not showing in appearance section. I created a separate function file named function.php and the code is: add_theme_support( 'menus' ); function ...
1
vote
1answer
117 views

Replace menu permalink/hyperlink with only menu name/slug

I don't know if i am asking this correctly, but i will try. I am doing this for history pushstate purpose. Code to get menu wihout ul and li: $topmenu= array( 'container' => false, ...
0
votes
1answer
32 views

wp_nav_menu doesn't work in a duplicate server

I duplicated my Wordpress installation to move to another server. Everything works find except one single file. I created a header-shop.php file to call a certain menu on my shop page. In the first ...
0
votes
1answer
40 views

Any simple way to show 10 previous pages by id to current page in links as a menu

I've been reviewing any plugin that may help in this but I got nothing. For a web using pages instead of posts, I may need to show in each page a menu consisting of 20 previous pages, or maybe 10 ...
0
votes
2answers
1k views

Admin top level menu, pointing to an external url

I want to create a entirely new top level menu in the admin menu section, and have that be an external link, is this even possible with the current system? The solution that t31os provides in this ...
0
votes
1answer
38 views

how to change single post link

I have made a website for a client which involves products tab in navigation. Products are the posts that being posted in "posts". I have a front-page.php which is static. posts are displayed in ...