Questions tagged [sub-menu]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
131 views

$pages = get_pages('child_of='.$post->ID); Why arguments are concatenated?

I am reading a book called "Learn to Create WordPress Themes by Building 5 Projects" . In that to retrieve the parent for pages, they have a function to get the parent of the pages. The ...
0 votes
0 answers
18 views

Add custom posts to submenu automatically

I'm trying to automatically add posts from a CPT to a submenu in Appearance > Menus. I've tried following this code suggested by @Bauwb add_filter( 'wp_get_nav_menu_items', '...
0 votes
0 answers
45 views

Display list of Custom Post

I created Custom Post Type News. I would like to show the list of Custom Post News at a sub menu of News Info. How can I do that ? My custom post type registration code is like below public function ...
  • 397
0 votes
0 answers
22 views

Sub menu is not working properly

I am learning WordPress Plugin Development. My code is like below. public function admin_menu() { add_menu_page('News Information', 'News Info', 'manage_options', 'news_info', [$this, 'api_key_page'], ...
  • 397
0 votes
2 answers
35 views

Is there a way to add the list of recent posts into the admin sub menu on hover?

If I need to edit a specific post then I need to click the "All Posts" link and then find it. It would be nice to click directly on a link from within the popup hover sub menu. Something ...
0 votes
0 answers
51 views

WordPress custom menu can't show 3. level submenu

I Use a custom walker from my menu in WordPress and my menu doesn't show all levels. https://soulofcroatia.com/ ->One Day menu item. This is my code in header.php <?php ...
0 votes
0 answers
71 views

How to access wordpress menu & submenu item through the REST API?

I want to display the menu & submenu items from Wordpress in another web-application, menu and Submenu are get but there is more menu inside Submenu I want that. function return_menus( $data ) { $...
  • 149
0 votes
1 answer
35 views

Use current class method inside add_submenu_page()

I have a class like below. namespace Inc\Admin; class Admin { public function __construct() { add_action('admin_menu', [$this, 'admin_menu']); } public function admin_menu() ...
  • 397
0 votes
0 answers
18 views

Type character in name and make it invisble

my website is using MyHome theme. I need to write identical names for two search fields. Here - https://komand.suvenirite.net/dava-pod-naem/?offer-type=rent And here- https://komand.suvenirite.net/...
  • 1
-1 votes
1 answer
26 views

How was this menu system created?

Can anyone give me a clue how this menu system was created? https://40thdems.org/ This is a WordPress site using the Divi theme. Thanks in advance for any pointers!
0 votes
0 answers
27 views

Link after <? wp_nav_menu() ?> Wordpress

Currently I am using: <?php wp_nav_menu( array('menu' => 'Second navigation', 'menu_id' => 'second_navigation', 'container' => false, 'menu_class' => 'nav', 'link_after' => '<span ...
0 votes
0 answers
25 views

Set one or more menus as a submenus of another menu

I'm working on a website that has several menu locations, each with their own menu. I'm also using a plugin (shiftnav), which defines its own menu location, and requires me to configure a menu for ...
0 votes
1 answer
144 views

How to buid wordpress menu with auto width sub-menu items in dropdown menu without any items sharing one line [closed]

How do I buid wordpress menu with auto width sub-menu items in dropdown menu without any sub-menu items sharing one line (appearing side by side).but with an automatic width for dropdown items that is ...
0 votes
0 answers
17 views

cannot get global $menu value in form request

I have register a route for edit_audience register_rest_route( 'ilms_plugin', 'edit_audience', [ 'methods' => 'POST', 'callback' => 'edit_audience', 'permission_callback' => '...
0 votes
1 answer
363 views

Show Sub Menu on click and not hover

I have a menu in which I am trying to get the sub menu to appear on click as opposed to hover. I have the hover styles set and working so when I hover the sub-nav appears as a block element. Not ...
1 vote
0 answers
27 views

Trying to Create Menu in Wordpress

I have been trying to create a mega menu on the WordPress website. The problem that I am facing is not able to create a mega drop-down for different services. What I want to create is: When should I ...
0 votes
2 answers
125 views

Looking replicate static HTML Menu into WordPress Dynamic Menu [closed]

We are converting our static HTML site to Wordpress. The conversion is going fine (for the most part) but the part I cannot figure out is how to build the menu so that I can retain the menu look from ...
  • 103
1 vote
0 answers
30 views

How do I add recent posts to the menu?

How to add recents posts to the menu? Entries with pictures. "Menu-item-object-custom" items in a div container? What I have now is: header.php wp_nav_menu( array( '...
0 votes
1 answer
92 views

Add Different Class on Different Ul in twenty-twentyone theme

I'm creating a custom menu with wp_nav_menu. I want to add different classes on menu and submenu which are coming under different li, but unable to find a solution. Can anyone help me to figure out ...
0 votes
1 answer
27 views

How to highlight 1st level menu item based on actual page

I am trying to highlight 1st level menu item by adding 'current-menu-item' class using nav_menu_css_class filter based on actual page / article / post / etc. For example, menu looks like this: ...
1 vote
1 answer
206 views

How to add ID attribute to each submenu?

I would like to add an ID attribute to each list <ul> submenu. I am using the Walker class extension. I have managed to modify some elements, but I am left to solve this one problem. I need the ...
0 votes
1 answer
67 views

add sub_menu to a sub_menu (multiLevel sub_menu) in admin menu in wordpress

I'm looking to add a submenu, to another sub_menu that already exists. In WordPress, there are just 2 levels of admin menu (with functions: add_menu_page and add_submenu_page), my goal is to add ...
  • 1
0 votes
1 answer
94 views

Why WP_Screeen doesn't show all options with admin_body_class

I was trying to add a specific class to the admin section. I created a new top-level menu page and now I want to add a specific class to this top-level menu and its submenu items. What I have tried so ...
0 votes
1 answer
72 views

retrieves menu and converts it to a readable array

I have added this code in function.php to retrieves menu and converts it to a readable array but It's not working and give me this warning. Warning : Invalid argument supplied for foreach() in C:\...
0 votes
0 answers
119 views

insert an HTML element if there is a submenu only

I am trying to insert an HTML element "an arrow or a checkbox" to make use of the "checkbox technique" so I can use it to expand the submenu "only if submenu is there" ...
  • 101
0 votes
0 answers
33 views

Links doesnt appear as a submenu on a mobile

Help needed. I've puted some pages in the submenu. Works perfect on desktop On mobile the pages doesnt appear as a submenu for some reason Link
1 vote
1 answer
63 views

Position image widget in mega menu

I need to add image in mega menu. So I have added image widget in menu. How can I reposition this widget. Currently my menu is showing like this. But I need image only in the right side, and sub ...
  • 61
0 votes
1 answer
384 views

How to change the URL of sub menu page?

I'm trying to add a sub page under users in admin panel and everything works fine but I have a little problem when clicking on the created page the url changes and refer to my page as query string not ...
0 votes
1 answer
23 views

How can I creat custom menu with bootstrap

I'm trying to create bootstrap collapsing navbar for WordPress template. I have to add some HTML properties such as data-toggle. After researching, I found that must customize the Walker class but ...
0 votes
0 answers
23 views

Notices are render inside sub-menu's content

I develop a plugin but I've got a problem when I render sub-menus (added with the hook admin_menu). At the moment of the callback, I render the content with the following: <div class="wrap"> ...
  • 1
0 votes
1 answer
2k views

Change hover to onclick on menu

I've got a local website on WP using DIVI where a header menu got some "menu-item-has-children". In way to view these sub-menu, I just have to hover on it and when mouseout the sub-menu disappear. ...
  • 101
1 vote
0 answers
145 views

Add toggle button for mobile sub-menus

Been playing with this for hours but not getting anywhere, please help! So I have a menu which works fine for the sub menu dropdown on desktop. What I want for mobile menus is for their to be an ...
0 votes
1 answer
78 views

wp_nav_menu container style args

I am trying to add CSS from a html theme that I included. When I add my primary menu function that I defined to load my menu section I don't know how to include CSS as it return a defult ul style. ...
1 vote
0 answers
73 views

disable menu collapse/expand function and make a menu item a static, unclickable text

In my side menu, I have this structure: Home Discussion |- Topic 1 |- Topic 2 |- Topic ... |- Topic N About us where Topic 1...N are sub-menu under "Discussion" and links to different pages. The ...
  • 111
0 votes
0 answers
62 views

Bootstrap Theme Migrated to WordPress

Looking for your expertise, as I'm fairly new using WordPress and I'm in the process of migrating bootstrap theme into it. Problem: I have a navigation menu in the header and want to have a ...
0 votes
1 answer
359 views

Wordpress + Bootstrap: Replace primary navigation menu on mobile?

So, I have a site that has a main navigation bar at the top and a secondary nav in the sidebar. The secondary nav includes the same links in the main nav but with dropdowns for the child pages. It ...
  • 101
0 votes
1 answer
418 views

How to add all subcategories as submenu in WordPress menu

I've more than 450+ WooCommerce product categories and subcategories. I want to add them all in the menu items, categories as a top level menu and subcategories as submenu. Is there any way to ...
  • 1
0 votes
0 answers
419 views

Theme: dropdown hover menu not showing up in IE/Edge

I'm using the theme Illdy, and the hoverable dropdown menus on the top navbar are not dropping down in IE or Edge. Firefox and Chrome appear to work. I've tried adding a variety of these to the ...
  • 11
0 votes
2 answers
487 views

hide page menu from admin panel for specific users

I want to hide page menu from the admin panel for a specific user type. I tried it with the below codes in functions.php function hide_menu_items() { global $menu; global $current_user; ...
  • 107
0 votes
0 answers
50 views

having a page in multi sub-menu and match current-menu-item

On a website I develop, some pages are in several sub-menus, like so: home | product category a | products category b * product a * product c * product b * product b --...
  • 209
0 votes
1 answer
543 views

Use a filter on menu items that have children

I have a nested dropdown. On elements that have children, I would like to add a chevron beside the link text. The current HTML looks like this: <ul class="primary-menu"> <li class="menu-...
  • 139
0 votes
0 answers
635 views

Problem add submenu page

I have no access to my menu. I am using the template Prolingua which I customized as well as wordpress. Here is the error message : add_submenu_page is called the wrong way. The seventh ...
1 vote
0 answers
24 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 ...
0 votes
2 answers
890 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-...
  • 101
1 vote
0 answers
43 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 ...
  • 209
1 vote
1 answer
1k 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
0 answers
195 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 ...
  • 858
0 votes
0 answers
21 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.
2 votes
1 answer
2k 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-...
  • 113
0 votes
1 answer
386 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> ...

1
2 3 4 5
8