Questions tagged [menus]

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.

Filter by
Sorted by
Tagged with
10
votes
2answers
8k views

Get page IDs from nav items

I am trying to get all the IDs in my navigation and convert it to a string so that I can use it with wp_query to get the pages that are only listed in the nav. The code to get the IDs: $menu_name = '...
1
vote
1answer
2k views

Show menu item only if user is logged In (not word press login)

I am working on a web app word press. I am new to word press So maybe you will feel that this question is silly, I tried everything but i don't want to use any plugin. here is what I need to show the ...
0
votes
1answer
1k views

Change “login/register” to “useraccount” when a user has logged in

I made a menu-button on my site's first page that show "login/register". I want to change its name from "login/register" to "user account" when a user has logged in. I tried changing codes in global....
0
votes
0answers
16 views

How to make Logout Link consistently appear on all web pages?

I am using the following code to add Log In and Log Out links in the Primary Menu. Can't give a web link because the site is still under construction. //* Add a Login/Logout toggle item in WordPress ...
0
votes
1answer
579 views

Mobile Menu Not Working

The mobile menu stopped working after I updated WP to the latest version, I assume it has to do with a customization of the theme. http://kvintage.com/ Wondering if anyone could please take a quick ...
0
votes
1answer
603 views

List all posts from custom post type by taxonomy

Having custom post types with taxonomies. Lets say I have a custom post type "Products" with taxonomies "new", "old", "fashion". Now I have a Nav where I can click on wordpress.private/products/new/...
1
vote
2answers
997 views

Highlight current post ancestor parent menu items

The default menu classes in WordPress are pretty useful. But one problem that i stumble over from time to time is with categories as subitems in menus. For example the following menu structure: Page ...
0
votes
0answers
40 views

Add CSS Class to Wordpress Menu Item Dependent on the Page the User is Visiting

I'm trying to have menu items show an underline under the related nav item when when the user on a specific page (image attached). In the static site version of the site I'm doing I had a php ...
2
votes
1answer
2k views

How do I give class to the dropdown sub-menu in the wp_nav_menu?

This is my html code <div class="section__main-nav" id="section__main-nav-id"> <div class="container"> <nav class="navbar navbar-toggleable-md navbar-light"&...
0
votes
1answer
14 views

How To Add The Help Scout javascript LiveChat from the WordPress menu

My client wants to add the live chat script code from here website, but he wants it to put on the specific menu /contact-menu/ I'm not how I could implement it. please let me know any thoughts about ...
0
votes
1answer
20 views

How do I scope out why I have two “posts” menus in an admin?

A site I'm working on has an odd problem: two sets of "posts" menus in the admin. The client brought me on board and says "it's been there a while". How would I go about finding out why there are two ...
1
vote
2answers
410 views

wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu

<?php wp_nav_menu(array( 'theme_location' => 'primary', 'container' => 'ul', 'menu_class'=> 'top-menu' ...
0
votes
0answers
4 views

Drop down menus for all available pages/posts

I need several drop down menus to appear next to some text. I am very new to WordPress development so bare with me. I only have the HTML part of the code and I'm not so sure about how to add the ...
2
votes
1answer
588 views

HTML in Menu Items disappear on save

I've created a menu that, instead of plain text, needs to have icons. Unfortunately the "CSS Classes" option provided by WP adds the class to the li rather than the a so the icon won't be clickable if ...
0
votes
1answer
638 views

Creating custom vertical menu

First of all sorry me for my bad English but isn’t my native language so I’ll do as best as possible to explain my problem. I want to create a custom menu with Walker_Nav_Menu that should look like ...
0
votes
1answer
24 views

How to avoid a duplicate query from using wp_nav_menu?

My theme need to render 2 menus in homepage. The rest pages only need one. As result is only homepage got duplicate query warning. After tracking down, I found out this was cause by wp_nav_menu. How ...
0
votes
1answer
29 views

How can I make a WordPress sub-menu with a top-level that isn't clickable?

My WordPress website has a "Social Media" menu. When using a touchscreen, when you tap the button, it takes you to a page. Only the little down-arrow next to it opens up the menu. This is because ...
1
vote
2answers
598 views

Custom Menu Broken WP 3.8.1 Update

Custom menu has stopped working since upgrading to 3.8.1. When trying to add items from the left they do not show up as movable items as they should do under Menu 1, however the text changes to: "Drag ...
0
votes
0answers
13 views

WP-CLI command to rename menu?

Do you know a wp-cli way to rename menus? I don't see any reference to that in the documentation. Tried wp menu: usage: wp menu create <menu-name> [--porcelain] or: wp menu delete <menu&...
1
vote
3answers
2k views

Debugging - trying to add search box to menus

I have already asked a similar question at stackoverflow (https://stackoverflow.com/questions/22492292/add-filter-in-wordpress-how-do-i-know-if-it-is-run), but maybe that was the wrong place? As you ...
3
votes
1answer
48 views

What does a walker menu mean?

I don't understand what is a walker menu in wp_nav_menu() function means. The document doesn't say much about it. What does it looks like in graphic or HTML?
4
votes
1answer
760 views

Custom Nav Walker menu - Display category count

I have a custom walker menu.( See the code below) I would like to have my nav menu like this: Where 495 is the total of the records containing childrens. Where 42 Number of published articles. Can ...
1
vote
1answer
774 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 ...
0
votes
1answer
16 views

Add image to menu item with AFC

I'm trying to add an image to menu item, can't get it to work. Here is my code. header.php <?php wp_nav_menu( array( 'theme_location' => 'side-...
1
vote
1answer
684 views

Create Dropdown menu Using wp_nav_menu() function

Kindly provide me wp_nav_menu structure to create the following dropdown menu. <div class="container"> <div class="nav-menu"> <a class="toggleMenu" href="#">Menu</a> <ul ...
0
votes
1answer
12 views

Scroll to ID broken in main menu

I've taken over the task to maintain the website of your orchestra. Unfortunately the previous maintainer installed quite a lot plugins so it's hard for me to figure out which plugin is actually used ...
0
votes
1answer
714 views

wp_nav_menu_items for one menu

I tested this tutorial. It works great. The problem is that in the tutorial there is one menu while I have 2 menus. Let me know how I can customize this function for the feature only applies to ...
2
votes
1answer
403 views

Replacing the NavWalker dropdown element

I'm creating a website for my school with Material Design for Bootstrap and the NavWalker is giving me some issues, I want to change the element of dropdown i.e. from ul to div. I've tried to edit the ...
0
votes
1answer
29 views

Show some menu sub items as dropdown under a menu item

I have made a custom wordpress menu - function my_custom_menu_item($items, $args) { if(is_user_logged_in() && $args->theme_location == 'primary') { $user=...
0
votes
1answer
737 views

Showing the same menu in multiple location

Today I have faced an weird problem regarding WordPress menus. Here is the register function of my menus - function register_adaptive_menus() { register_nav_menus(array( 'top-menu' => __( 'Top ...
0
votes
1answer
1k views

Plugins & Setting Menu Items Removed From Admin Panel

I am unable to add any new plugins and can't see menu settings as well. I think it's been disabled. How do I bring these admin menu items back? Here's what my admin panel currently looks like:
1
vote
2answers
1k views

Custom dashboard menu does not stay open for the custom Taxonomy within it

Short Version: Custom menu with a custom post type that supports a custom taxonomy. The custom post type works, the menu for it works and stays open. The custom taxonomy works, but the sidebar menu ...
0
votes
1answer
21 views

Remove unwanted elements for a wp_nav_menu

I am working on building a custom mega menu within Wordpress.I am running into an issue with unwanted elements being displayed from wp_nav_menu which are distorting my menu. <?php wp_nav_menu( ...
0
votes
0answers
34 views

Adding a drop-down (select tag) option under Menu Settings in WordPress Admin

I looked (surfed) around a lot to get idea of how can I add custom field/drop-down under "Menu Settings" in WordPress Admin. I want a select tag with options from which I can get value based on the ...
-2
votes
0answers
13 views

porto theme responsive menu toggle not working

i have use porto theme and my theme version is 5.0.1 Desktop menu working fine but in responsive menu when i click on toggle button still not working for me i have try to add custom jquery in ...
0
votes
0answers
11 views

I want to print categories and sub-categories and so on

I want to print categories and sub-categories and so on in way that it looks like. cat1 cat2 cat3 cat1.1 cat 1.2 cat 1.3 cat1.1.1 cat1.2.1 cat1.3.1 It looks like menu I have ...
0
votes
1answer
624 views

Change header menu login-logout without changing main menu

I'm trying to change the header menu, such that it looks different when it is logged in and logged out, without changing the main menu. function my_wp_nav_menu_args( $args = '' ) { if( ...
0
votes
1answer
161 views

sub menu link is not working

I am using a theme which is showing table of content by using this code : <div class="menu-panel"> <h3>' . __('Table of Contents', 'odrin') . '</h3> ...
0
votes
1answer
714 views

Add/Remove current_page_parent class

I created some custom post types and custom taxonomies, if I'm on an archive page of the custom taxonomy, the Blog menu item is highlighted due to the current_page_parent class. Well this is obviously ...
0
votes
0answers
18 views

Why my dropdown menu is effecting main menu?

I have items in menu. And in one menu has drop down. I added in general way. But not working. It is breaking other menus. See the menu adding in wordpress.
0
votes
0answers
10 views

Making drop down menu images the same dimensions as others?

I am working with a website which had been previously professionally designed. On the drop down menu, they had attached images (seemingly without a plugin) of a certain size. None of the image ...
0
votes
1answer
13 views

Adding additional html to the end of the root level in a custom nav walker

I have a custom nav walker, which essentially just add's new classes to the menu, however, my menu also contains some hard coded elements at the end (Contact button & Search Icon). Where/How to ...
0
votes
1answer
22 views

Does the Default theme of Wordpress like 2016, 2017 and 2019 uses Walker_Nav_Menu Class

I want to know if these themes uses Walker_Nav_Menu class. As I open the files I can't see a Walker_Nav_Class or I could not find it. And I want to know what they use to display the Menu and Submenus. ...
2
votes
1answer
652 views

How do I approach removing menu items on the fly based on settings in my plugin?

I've started writing a plugin that allows the administrator to select specific pages and set them to be visible only to logged-in users; the plugin optionally applies the restriction to all child ...
1
vote
0answers
22 views

Custom Nav Walker Trouble

I got a snippet for a custom nav walker online and it works fine for the main menu items. I can't figure out how to get it to work for the sub-menu items. This is what i'm trying to achieve: <ul ...
0
votes
1answer
27 views

Wordpress category title not update in navigation menu

I have simple situation but can't get the right answer and solution Problem: for example my woocommerce category name “soup, noodle & pasta” I add this category in my menu and after that will ...
0
votes
0answers
10 views

Sub Menu does not display using Nav Walker

I have a submenu and I put a nav walker from a github source and my submenu does not display. Here is my code in header.php <nav class="navbar navbar-expand-md navbar-light bg-light" role="...
0
votes
1answer
33 views

How to add css to single navigation text? [closed]

I only want to edit the "ticket". in the photo I only add the CSS in the inspect. I want it to be that size.how to put CSS in that span ?? I did add extra CSS class in the menu. but it only changes ...
0
votes
0answers
5 views

Menu doesn't collapse after choosing menu item (mobile only)

I have a problem with my menu on mobile. After selecting the item I want from the menu, it doesn't collapse and I have to manually click on the "x" to close it. I am trying to fix with this jquery: ...
0
votes
1answer
29 views

Custom Nav Walker Displaying Values in Sub Menu

I'm trying to display Submenu links within a Custom Tailwindcss / Vue component that I added within the Nav Walker. Menu Issues header.php <nav class="flex items-center justify-between flex-...