Questions tagged [sub-menu]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
556 views

Add code to WordPress menu items by class

I am trying to add onclick="toggle_visibility('sub-menu');" into the opening tag of specific menu items generated in WordPress. I have used the following function to target all parent menu items ...
2
votes
1answer
451 views

How to display dynamic content in start_lvl function

I am creating a custom nav walker but having trouble outputting parent menu item title in start_lvl function. I want to output it right after the <div class="dropdown"> in the following ...
0
votes
1answer
1k views

Custom Nav Walker sub-menu

I am trying to change the markup of my main menu. Currently I've got the following code when my menu is generated : <ul id="menu-menu" class="menu vertical medium-horizontal"> <li><...
1
vote
0answers
13 views

Hierarchical menu nesting problem with jQuery targetting

(Wordpress's menu use the form <li class="menu-item-has-children"> Item <ul class="sub-menu"> <li> Sub Menu Item</li> ... </ul> </li> ... which means ...
1
vote
3answers
1k 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
1answer
22 views

Hide product categories and taxonomy terms in menu if empty

I've been researching this and had no luck so far. I have a WooCommerce store with a main menu showing product categories (product_cat) and brands (yith_product_brand) which is a custom taxonomy. I ...
0
votes
2answers
13 views

How can I click the parent menu then redirect to a special URL?

You see I have a Navigation bar items, in the parent item Products & Services with two sub menus. I have a requirement, when I click the menu item Products & Services it redirect to its sub-...
1
vote
0answers
15 views

From a page, is it possible to find entry's “menu_item_parent”?

The idea would be to be able to retrieve a sub-menu matching a given page to display it as an aside on page. As an exemple, let's consider this menu: Home Outdoor MTB Rock climbing Running Hiking ...
3
votes
2answers
2k views

Customizing the a tag with Semantic UI

I'd like to use Semantic UI to aid development of a Wordpress template for a project. For a submenu I intend to use one of the Secondary sub menus found just at the bottom of the Pointing section. ...
0
votes
0answers
25 views

Separate categories from my submenu and their latest posts

I have a menu with <? php wp_nav_menu() ?> in which I integrated a Walker menu to be able to display the latest posts for each category of my submenu! It works, but I would like to have the ...
2
votes
1answer
591 views

Automatically Add New Tags to Sub-menu

Been searching for any related plugins or info. about this case but didn't find anything relevant or working. I need every new tag that is added to a post automatically appear in a menu as a sub-menu ...
0
votes
0answers
11 views

Add icon based on recent post to Blog submenu in wp_nav_menu

I am thinking of adding an icon to my Blog menu title in Wordpress. Like a red circle indicating there are new recent posts. The wp_nav_menu $link_after and $after attributes apply to all menu items ...
4
votes
3answers
5k views

Order Admin sub-menu items?

I am adding items to a CPT Admin menu using add_submenu_page which works great, but they are added to the bottom of the sub-menu after the CPT options. I want to be able to have them on top , but I ...
0
votes
1answer
325 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
2answers
439 views

How do you manage large menu hierarchies in WP?

Has anyone worked on sites where the menu hierarchies is fairly large? Not more than 3 levels deep, but more than 40+ menu items? If you only list first level items in the top menu without dropdowns ...
0
votes
1answer
659 views

Adding Meta Box to Specific Submenu Page

I've created this page: function wpdocs_register_my_setting() { add_submenu_page( 'edit.php?post_type=task', 'View Tasks', 'View Tasks', 'manage_options', '...
0
votes
0answers
50 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 ...
0
votes
0answers
21 views

drop down menu not working on wordpress it will redirect to base url

I have faced an issue on WordPress dropdown menu. When I click the link it will be redirected to base_url but the main menu is working properly. I changed the permalink to Post name but it still not ...
0
votes
1answer
166 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
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
2answers
2k views

Show custom menu in category and its posts

I have a category X of posts. The category page and it's individual posts are all part of a custom menu consisting of pages and posts. My submenu, in the sidebar, works fine for showing on the pages, ...
0
votes
1answer
51 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-...
0
votes
0answers
14 views

Parent menu item with character space breaks dropdown for submenu

My team has a WordPress site with a custom FoundationPress theme. One of the primary nav items is "About us", this item has secondary items nested beneath it in a submenu. This is configured in the ...
1
vote
2answers
6k views

Multi Level Bootstrap Navigation Menu in WordPress

I am converting a static website made with Bootstrap in WordPress. Here is my bootstrap multilevel navigation menu code: <section class="menuBar"> <nav class="navbar navbar-expand-lg ...
0
votes
1answer
922 views

Always show wordpress submenu on responsive header menu

I'm trying to edit my CSS to always show all the li tags inside my header menu, also with ul.sub-menu li; I just want to show all the items from the menu, but I'm working on it for hours and I've ...
2
votes
1answer
1k 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
64 views

Adding toggle-able element after menu item

I've got this menu on my site: <ul id="menu-primary" class="offcanvas"> <li class="menu-item menu-item-has-children"> <a href="#">Parent</a> <ul class="...
0
votes
1answer
432 views

How to keep the plugin submenu open on viewing a custom version of users.php?

I have added to my-plugin submenu a custom view of the user list using users.php and a my_plugin_view argument to filter the request: add_submenu_page( "my-plugin", '...
0
votes
1answer
12 views

Submenu Page under Settings in Admin Panel

I have a quick question, I am wanting to add in a new submenu to the 'Tools' section on my Admin Panel but without modifying any of the original WordPress files such as (functions.php, etc..) files. ...
2
votes
1answer
389 views

Two Navigation Menus - secondary nav is including main nav

Two Navigation Menus in Themes Produce the same menus? reference the subject on page link above. i created two navs, yet the secondary nav includes all pages. the main nav is fine, but the secondary ...
0
votes
1answer
22 views

Remove All in One Pack from the admin bar

Hello I want to remove All in One Pack from the admin bar. I can remove anything else but it. I have already removed other things like update from the admin bar using this method Get the menu's id ...
2
votes
3answers
9k views

Adding different classes to anchor in navigation menu

Is this possible? I want to add different classes to the anchors, so not the same on all anchors. How can I do this? PS: I am using this: function add_nav_class($output) { $output= ...
0
votes
1answer
401 views

Add a Submenu from Another Submenu in a Custom Theme

Good day everyone! I would like some help from you since I'm just a beginner in WordPress. I would like to add a submenu under another submenu like this: International China Independent Group Tours ...
4
votes
2answers
2k views

How Can I remove or hide the export page in WordPress menu?

I'm trying to remove the export.php page from WordPress admin menu -> tools for a multisite so only the network admin could see it I have the following code so far but can't get it to work. //******...
0
votes
1answer
13 views

Get Child of Child Pages in custom Menu

Got this bit of code which runs which gets the Page ID and displays all the children under it. Which is good. Part two of this is getting it to pull in the child of children items. So currently ...
0
votes
0answers
9 views

How can I add plugins submenu at the toolbar on different roles in wordpress?

I want to add a menu at the toolbar of the backend wordpress but the problem is there is submenu on that plugin and also roles in it.
0
votes
0answers
14 views

Highlight “shop” in menu when on product page, without showing a sub-menu?

I've tried doing some research on this but can't get my head around it... I have one main menu where I want to highlight a page (named "Shop"), but don't want a dropdown menu with sub-pages (product ...
0
votes
0answers
16 views

Mega menu 3rd level sub menu overlapping with second level menu [duplicate]

i am created mega menu two levels worked fine 3rd level sub child menu overlapping with second level menu problem with Z-index my website url : http://3.9.10.5/ (3rd menu Treatments > Wrinkle ...
-1
votes
1answer
23 views

How to display a submenu as a popup when clicking a button?

I have a submenu that contains several items. The submenu currently displays when the user hovers over a main menu item in the top menu bar. I want to place a button in the middle of the page that, ...
0
votes
0answers
24 views

Placing custom post types as submenu in admin menu and moving additional admin elements around

So, in my custom Wordpress plugin I have two custom post types. My customer wants to have them grouped under one main admin navigation item. I go and create the main admin item using: add_menu_page(...
0
votes
1answer
4k views

How to add a submenu toggle button inside all “li” elements that have a submenu?

I'm building a mobile navigation menu. I wan't the menu to work like this: In this image you see a mobile nav with multiple depth levels. This is how I wan't the code structure to look like: <ul&...
-1
votes
2answers
110 views

How to keep close a sub-menu under homepage? [closed]

I am facing an issue in the Avada vertical menu when the homepage is opened. Please note that all "Home", "Company profile" and "Servizi" link to the same page (the homepage). The sub-menu under "...
0
votes
2answers
1k views

Insert & order custom post types in/as submenu

TLDR: While in the backend, I would like to add custom post type inside a menu page (which I can do). But I cannot order the resulting submenu pages. I have 3 custom post types “A”, “B”, “C”, and I ...
2
votes
2answers
6k views

Nav walker, bootstrap: Display 3rd level items under 2nd level

I am using the WP_bootstrap_navwalker for a dropdown menu. This works fine, but it only shows me the first and second level items. So de dropdown on the first level and a regular second item when ...
1
vote
0answers
72 views

Automatically list top level menu item child pages

I am building a website that has a lot of pages. The client is not a big fan of the Wordpress menu builder works (in appearance -> menus), and we have come to the conclusion that the best way for the ...
6
votes
7answers
20k views

how to create a menu with all sub categories?

Is it possible to create a menu with a category such that each time that I had a sub category that automatically display on the menu? As far as I know, if I have a menu with the category "fruit", and ...
8
votes
4answers
18k views

Remove Categories / Tags From Admin Menu

I want to remove or hide Categories / Tags submenu under Posts in the Admin Menu. I know this works with the themes submenus: remove_submenu_page( 'themes.php', 'widgets.php' ); The same doesn't ...
0
votes
1answer
2k views

How to display list of child pages with parent in wordpress?

I have following format of sub-pages in WordPress: About Us -Services -Products -Surgery I want to list all sub-pages with parent page like above but the code that I am using from ...
0
votes
0answers
15 views

How to Remove default Nav Menu Class and/or put my own class on menu li ul tag | no plugin

I want to remove this default class on ul li tag and want to add my own class ID <div class="menu"><ul> <li class="page_item page-item-58">About US</a></li> <li class=...
0
votes
2answers
99 views

Menu walker: how to tell if a sub menu contains submenus?

I mean: <ul> <li> <ul class="sub-menu"> <li> <ul> <li></li> <li></li> <li></li> ...