Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [sub-menu]

The tag has no usage guidance.

120 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
258 views

Generate a tabbed submenu — from taxonomy term or submenu item — with sample content

I'm looking to generate a tabbed submenu from taxonomy term or submenu item and include sample content (three items per term/submenuu item). The styling I can do, the problem is the html generation. ...
2
votes
0answers
572 views

Update Nav Menu Items Programmatically

I know this may sound stupid, but I created a code which (in theory) should add a few submenus to my primary menu. However I don't seem to be able to display this new menu because I don't know when I ...
2
votes
1answer
443 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 ...
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 ...
2
votes
1answer
580 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 ...
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 ...
1
vote
0answers
69 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 ...
1
vote
0answers
731 views

bootstrap menu parent toggle and arrow

I have created a menu in Bootstrap 4: Here is the code: <section class="menuBar"> <nav class="navbar navbar-expand-lg navbar-light" data-toggle="sticky-onscroll"> <div class="...
1
vote
0answers
35 views

Remove add news page and posts from menu

I want remove add news page and posts from left menu I try to use remove_submenu_page('edit.php', 'post-new.php'); but it only remove add news from posts, I need to remove add news from pages too.
1
vote
0answers
446 views

Add Product categories to Wordpress menu without losing hierarchy

I need to add product categories to Wordpress menu, but when I'm doing this with WP interface it lose the hierarchy I tried with WP-CLI, but there is no method to specify wich item is the child. ...
1
vote
0answers
202 views

How to retrieve parent menu item name of current submenu item

I have a menu item Services which has 5 submenus. Now when I click on one of those submenus, like Flexible Endoscopes I manage to echo the title of child item or current page title. But I can't find ...
1
vote
0answers
1k views

Check if menu_item has children or has parent

I am using wp_get_nav_menu_items() to get the menu items and this is my HTML structure. Only items with submenu items should have the dropdown class attached to the li tag. <ul class="nav navbar-...
1
vote
1answer
544 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 ...
1
vote
1answer
228 views

Combining 'depth' with 'include' in wp_list_pages()

I am using wp_list_pages to display my navigation that contains only specific top-level pages using the include parameter. However, I would like to display the child pages of those top-level pages. ...
1
vote
0answers
31 views

Submenu causes issue in defined blog page

I've inherited a WordPress project with a heavily customised theme. Currently have an issue when viewing the blog when there are no current post entries. Within the theme code, there is an include to ...
1
vote
0answers
15 views

Define supporting only 1-level menu

please help. Is there any way for the theme to define this theme support only 1-level menu only? I mean is there any hooks, actions, filter so that when user go Admin Panel > Appearance > Menu, ...
1
vote
0answers
479 views

Register submenu on network menu from the subsite

I have a multisite like this: MainSite Site1 Site2 I want to register submenu page on active site in parent page /wp-admin/options-general.php on network in parent page /network/settings.php If ...
1
vote
0answers
258 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
0answers
59 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
35 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: ...
1
vote
1answer
37 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
1answer
331 views

Change submenu markup

I've seen people recommending to edit the wordpress default Walker to change the menu markup and create your own. The problem with this is that I would like to change the markup of the submenu and ...
1
vote
0answers
186 views

getting the current sub item out of total sub items in a given dropdown (custom walker)

i would like the possibility to append a text(denoted in square brackets) to each sub-item in the menu like so: Parent 1: sub-item [sub item 1 of 5] sub-item [sub item 2 of 5] sub-item [sub item 3 ...
1
vote
0answers
53 views

Is there a way to establish parent/child relationship in WP menu links exclusively?

to expand on this question title: Is there a way to establish a parent/child relationship of menu links (using the WP menu) that adds the dynamic helper classes (ie. current-menu-parent, current-menu-...
1
vote
0answers
266 views

Custom megameu walker need improvement

I'am working on a custom megamenu that will look like <li class="l-nav-item l-mega dropdown"><button class="open-icon visible-xs fa fa-angle-down"></button><a href=" ">...
1
vote
0answers
274 views

Removing “Sub-menus” from My Sites Drop-down in Admin Bar

How does one remove the "sub-menu" that appears to the right of each site listed in the My Sites drop down from the admin bar? That is, I want to have a list of My Sites without the Dashboard/New ...
1
vote
0answers
180 views

Using parent slug variable to display proper submenu not working properly

There are three submenus I have which display based on where you are in the site using the "the_parent_slug()" function. (personal-liability, life-and-health, and business) So when I use the search ...
1
vote
0answers
112 views

What action/filter/function determines “current” class in WP Admin Menu

I have created a submenu page for the Media List Table. The link actually points to a custom view I have created called Resources. I am looking for the correct location where the Admin menu determines ...
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
0answers
24 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 ...
0
votes
0answers
9 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 ...
0
votes
0answers
13 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
0answers
49 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
20 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
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
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 ...
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. ...
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
22 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
0answers
14 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
0answers
118 views

Displaying product thumbnail category on hover in menu

I need a submenu like this one: https://www.groupelacasse.com/ (products submenu) Where there's an image and products category. When a category link is hovered, its category thumbnail is displayed ...
0
votes
0answers
55 views

Filter parent_file doesn't working

I am trying to highlight an admin menu option (top level or submenu) but it just doesn't work. The code should be pretty straight forward but it seems that my filter isn't triggered. add_filter('...
0
votes
0answers
76 views

Native admin table with search functionality: sorting by columns does not work

I display a WP_List_Table on a submenu_page and offer a search function, which works. However, if I sort by a column within a search result, all records are displayed again. I really don't know why ...
0
votes
1answer
24 views

Creating navigation out of specific IDs and their children?

I'm looking for a way to list three specific pages in a nav-menu (I want to get these pages by their unique page ID's), and also list the children of these three pages - appended to each list item, in ...
0
votes
0answers
39 views

Display parent title in sub menu

I have this type of menu : Menu 1 Submenu 1 Subsubmenu 1 Subsubmenu 2 Subsubmenu 3 Submenu 2 Subsubmenu 1 Subsubmenu 2 Subsubmenu 3 Menu 2 ... I want to display, only in the submenu, the ...
0
votes
0answers
20 views

how to link local pages with flags in submenu

we have 4 flags on our website in the submenu. two, german and english are leading to the internal translation (wpml) the other two (chinese and russian) are leding to external links (local copies of ...
0
votes
0answers
19 views

How to remove parent menu item?

I have a menu, all sublisted listed under parent menu item 'home.' The issue is, I don't want a parent menu item. I just want menu bars - > click on it=drop down. At the moment I have 'home' - - > ...
0
votes
0answers
134 views

Product categories are not showing up completely

I have used Bulkpress plugin to be able to upload 700+ product categories. Now I wanted to create menu item 'Apple' and there will be a dropdown with all the Apple models (subcategories) listed once ...
0
votes
0answers
73 views

Make submenu stay open until other menu item is hovered with submenu's

I want to create a menu with a submenu in my wordpress site like this website has done: https://www.opmaatzagen.nl/ When you hover a menu-item a submenu is becoming active and stays active until you ...