Questions tagged [sub-menu]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
140 views

Adding span to a particular text in an menu item

Read many posts regarding this but all are for all menu items. Issue is: I want to wrap some text in menu item. I tried adding HTML to menu but that does not work because of Walker_Nav_Menu class ...
0
votes
2answers
47 views

Displaying a part of a menu containing the page the user is currently viewing and only it's immediate children

So this is what I'm fruitlessly trying to achieve - let's say there's a menu like the following... What I'd like to do is to generate a menu with just the title and the link of the current page the ...
0
votes
2answers
297 views

Make Home page current if there are sub-menus

I'm kinda stuck here. My home page is set to show the recent posts and in my menu I have home page link. But it's not highlighted as current - screen When I click on the home link I transfer to the ...
0
votes
1answer
53 views

I can't correctly display menu

I'm new in WordPress so I'm sorry if I repeat question. I have theme in HTML/CSS and I want move theme to WordPress and I have problem with my menu. Below I show my problem. I have menu in HTML: In ...
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-...
0
votes
1answer
131 views

Restrict days in bootstrap datepicker using checkboxes in submenu

MY SITUATION I've created a submenu in my Custom Post Type. In this submenu, there are 7 checkboxes for each date(Monday till Sunday). I use these boxes for selecting the days my restaurant is closed....
0
votes
1answer
145 views

sub-page settings saving in NETWORK DASHBOARD

In single WP installations, on a plugin's generated sub-page, you put <form action="options.php" ... does the job well. However, in Multisite Network sub-page, options.php doesnt work, nor ...
1
vote
1answer
791 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
4answers
6k views

How to get a separate child menu?

Didn't thought I would have to ask this question. But yes, it's true. It seems you can't have a separate child menu in Wordpress? I'm absolutely not a beginner on Wordpress. Have worked and developed ...
0
votes
1answer
37 views

Role exception for a settings sub menu

Im fairly new to PHP so bare with me. So i have a sub menu in the backoffice settings and i need to grant an exception for this sub menu for specific users, but i have no ideia how to do that. This is ...
0
votes
0answers
729 views

WordPress menu walker - Get parent item text inside end_lvl function

I have a parent menu item which is taxonomy name. I want to add in a mega menu with a featured post from the menu taxonomy in the left of the sub menu. This code works and shows displays the html ...
0
votes
1answer
1k views

Add child pages to submenu automatically

If a new page is added under a parent page (front end), which is part of a nav menu, I want the new page to be added to the appropriate submenu automatically - without any plugin. Reason: A custom ...
1
vote
1answer
280 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. ...
0
votes
1answer
70 views

why is this function firing on all child menu items as well?

I'm using this simple function to add a dropdown indicator to my menu. However, I am getting a dropdown indicator on all children of the <li> that has the class menu-item-has-children. How do I ...
0
votes
2answers
22 views

Need help finding information to create this type of page

I'd like to create a menu that can be selected on a page and display information pertaining to what was selected from the page menu. Just like what the WNBA has on this page for their teams schedules. ...
0
votes
1answer
13k views

How to use wp_nav_menu to create custom dropdown menu?

In my template I have a custom menu. Below is the HTML code for it. Inside the menu there is one dropdown menu and a link tag. <ul class="nav navbar-nav"> <li class="active"><a ...
0
votes
1answer
60 views

How can i create menu like in the example?

i try to create menu loop with structure like below, but i cant, default function wp_nav_menu doesn't allow to do that, i don't understand hot to do it. I need structure like in example with data-...
0
votes
0answers
27 views

how to create pages and link them to a menu

I am having some issues linking pages to the menus I have created. I used "appearance"-> "Customize"-> "Menu" and created custom menus from there since I cannot access my "Appearance/menu" properly. ...
0
votes
3answers
3k views

How can I add a sub menu to an existing navigation menu in WordPress?

I want to add submenu to a navigation menu in wordPress through code (not through admin panel) and I am totally new to Wordpress. Any help would be greatly appreciated! Thanks!
1
vote
1answer
516 views

No “current-menu-ancestor” class added when browsing an archive page

I have a menu set up like this: Page 1 Page 2 Page 2.1 CPT Archive Page 2.2 Page 3 etc... And when I navigate to the Archive, the Page 2 menu item does not have the "current-menu-...
1
vote
1answer
3k views

Wordpress bootstrap menue with 3. level

I'm using bootstrap 3 and a navbar as navigation. I have found this Code to create the menu, works like a charm: https://developer.wordpress.org/reference/functions/wp_get_nav_menu_items/#comment-1609 ...
1
vote
2answers
3k 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 ...
1
vote
0answers
35 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
18 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
1answer
985 views

wp_nav_menu() with multiple Class

I'm trying to make a menu with wp_nav_menu(). I'm trying to add multiple classes but I don't have experience with this. I think I have to overwrite a class but ... <div class="top-menu"> <ul ...
0
votes
1answer
597 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", '...
2
votes
2answers
7k views

Simple Navigation Walker – Wrapper-class around first sub-menu

I'm trying to wrap the first sub-menu of a navigation into a seperate div. None of the children or sub-levels should get the same treatment. I'm really new to the Nav Walker-thingie and I'm really ...
0
votes
1answer
89 views

Beyond widget side menu editing, with the php page, custom template

Looking to reorder the side sub navigation to match the postings. How would I do this? Here is the page: http://www.testdevices.com/about-test-devices/staffexperts/ This is NOT controlled in the ...
0
votes
0answers
2k views

Adding a submenu to the Tools menu returns tools.php in a popup box

I am trying to add a submenu to the Tools menu. When the custom Tools sub-menu is chosen, I want it to call a function. That function will echo things out to the browser page that is loaded. My ...
1
vote
0answers
606 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 ...
0
votes
1answer
206 views

Get parents child pages

I have this code: <?php global $post; $children = get_pages( array( 'child_of' => $post->ID ) ); if ( is_page() && $post->post_parent > 0 ) { // Is ...
2
votes
3answers
9k 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 ...
3
votes
2answers
2k views

Reorder custom submenu item

In the Settings menu, I have the following menu items listed: Settings -- General -- Writing -- Reading -- Discussion -- Media -- Permalinks -- Blogging I'd like to the Blogging (options-general.php?...
2
votes
2answers
3k views

Custom Walker for Walker_Nav_Menu

I'm trying to add a custom menu structure for my WordPress theme. This is how I want it to look: <li> <a href="link_to_parent_item" class="main-category" tabindex="3">Parent Name</...
2
votes
1answer
597 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
469 views

How to create a subcategory to a PAGE on WP?

I have a URL: www.example.com/banana-lp and I want to change it's URL to www.example.com/lp/banana I have been searching for how to do this everywhere but only found how to get this done by "posts"...
0
votes
1answer
56 views

Print Dashboard submenu name and filename

Similar to my previous question, I want to print a list of all of the submenu items in the Dashboard like so: Updates > update-core.php Library > upload.php Add New > media-new.php etc... This is ...
1
vote
1answer
224 views

How to target grandchild of post_parent using wp_list_pages

I have a much larger problem I posted earlier (still unanswered) which I might be able to solve if I can find a way to target the grandchild (or third level post) of a parent post. Right now, this ...
0
votes
0answers
138 views

Conditional Nav Menu Inside Nav Menu Across Multisite Sites

I am attempting to use the main site menu across a bunch of sub-sites in a WordPress multi-site configuration. The sub-sites use the main site's navigation. However, I want to omit one tree of links ...
0
votes
1answer
2k views

How to get submenu of admin menu?

I user global $menu in one of my plugins to get the list of menu items. But i would like to get the list of of items from a submenu for example from Posts i would like to get Add new, All, Edit ...
0
votes
1answer
855 views

How put the correct URL to sub-menu plugin?

I'm trying to build my first plugin and building my plugin menu like this: function group_panel(){ include('html/example.html'); echo "<h1>{$_POST['data']}"; } function ...
1
vote
1answer
1k views

How to display submenus on page based on referring top-level parent?

I am trying to display a secondary menu on pages that displays all the coordinating sub-pages of the top-level menu item they navigated there from, but my issue is that some pages appear under ...
0
votes
1answer
911 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
1answer
475 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 -> ...
3
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
0answers
202 views

Problem with sub-menu container

I try to add container for of main navigation menu. This is entire functions.php of my custom theme: <?php function gzabrze_menu() { register_nav_menu('glowne',__( 'Menu Główne' )); } ...
1
vote
2answers
654 views

How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()

I want to add custom classes to my menu items. For every subpage I show its siblings as a navigation: global $post; if ( is_page() && $post->post_parent ) { $...
0
votes
0answers
27 views

Has there been any improvements to wp's menu handling?

So I've been snooping around to see if there has been any change to how menus work in WP, but I haven't found anything yet. Some of the problems I have expereinced: Menu items still remains in ...
0
votes
1answer
909 views

How to sort a sub-menu, generated with get_pages(), by the page order instead of alphabetically?

I want the top nav on a wordpress site to automatically show the child pages. I know that I can edit my menu and add the children, but I want them to appear automatically, and for the menu to update ...
4
votes
1answer
11k views

Add class to top level menu item if it has multiple child levels

I have a WP nav menu, and I need to add a class to any top-level <li> if that item has more than one level of child items (meaning, its child submenu has a submenu too). Like this: <ul> ...

1 2
3
4 5
7