Questions tagged [wp-nav-walker]
The wp-nav-walker tag has no usage guidance.
106
questions
0
votes
0
answers
20
views
wp-bootstrap-navwalker changing the screensize of when dropdown is activated
I'm using bootstrap nav walker to build my navigation however, it does not show the drop down on landscape mobile devices ive looked at othe questions and took the advice of changing .navbar-expand-md ...
0
votes
0
answers
28
views
Multi-level submenu for wordpress website wp_bootstrap_navwalker.php
I have been working on wordpress website and the theme am using used bootstrap 4 wp_bootstrap_navwalker.php for menu and my problem is the sub-menu doesn't display as expected, one is above the other ...
0
votes
0
answers
39
views
Walker $args receive object on local and array on production
Have an issue on local machine print_r($args) give me stdClass Object, on production i receive array instead. I Check PHP version and WordPress version, they are the same. What can affect the format ...
-3
votes
1
answer
53
views
Why is VS Code saying this PHP code doesn't match signatures?
I'm using the code below in a WordPress plugin project. VS Code is giving me an error that says:
Method 'Acorn\UI\Mobile\MenuWalker::start_lvl()' is not compatible with method 'Walker_Nav_Menu::...
0
votes
1
answer
87
views
How to target the hamburger <span> (WP Bootstrap Navwalker) in mobile view
I want to change icon's color to white, but can't seem to target it properly. Is there any way of targeting it from the main.css, or only in HTML class with Bootstrap (and if so, how?).
HTML:
<...
0
votes
0
answers
37
views
Wordpress - custom walker menu
can you please help me with my custom menu for WordPress?
I was never building any custom menu with a non-default WordPress structure. How could I build this one? I need there add my custom classes ...
0
votes
0
answers
36
views
How to include second layer sub menu to Walker Nav?
I've managed to add the Walker class to my nav-menu, but I can only get to the first layer of sub-menus. I need to be able to access the sub-menus of the sub-menus on my nav. I know very little of ...
0
votes
0
answers
87
views
How do I generate a custom ID for a Wordpress submenu Nav item using the Walker Class?
I am creating a custom WordPress theme from scratch but I'm still quite new to PHP syntax. I had to figure out a way to modify the nav menu tree and found out how to apply the Walker Class to better ...
0
votes
1
answer
106
views
WordPress Custom Menu 3rd level with Walker
Hi I have a menu that I want to move to WordPress, how can I specify my classes, sub-classes, sub-sub-classes using the walker? You can also notice that I want to add a button to each menu item, the ...
0
votes
1
answer
42
views
wp-nav-menu generateing an empty a tag
Wp_nav_menu is generating my list fine but it is adding a tags that link to home but have no content is there a way to stop these from appearing.
<ul id="menu-main-menu" class="menu&...
0
votes
1
answer
149
views
How to add class to last <li> in Wordpress navigation bar?
So I'm using a custom navwalker in wordpress, as shown below:
function start_el(&$output, $item, $depth = 0, $args = null, $id = 0)
{
$title = $item->title;
$permalink = $...
0
votes
1
answer
169
views
Add div's into wordpress navigation
I am building a custom wordpress theme using underscores and want to add two div's inside the navigation. I know I have to use a custom Walker, but I don't know exactly how and all i can find is how ...
0
votes
0
answers
248
views
Custom nav walker for one item in menu wordpress
I need to make a separate nav walker for one item in menu wordpress.
I just have a different layout when I hover the "shop" link. Currently, the code I have works for all elements:
class ...
0
votes
1
answer
45
views
Error when using WordPress walker (Walker_Nav_Menu), class inserting Anchor parent in submenu
This class creates a menu with different sub-levels :
class Bootstrap_Collapse_NavWalker extends Walker_Nav_Menu{
public function start_lvl( &$output, $depth = 0, $args = null ) {
$output .= &...
0
votes
0
answers
231
views
How to align a dropdown menu under the parent item in wordpress
I created a dropdown menu for my custom wordpress theme. To customize it I'm using a custom walker, but I don't know how to align the dropdown on the left and under the parent "Cours".
I'm a ...
0
votes
0
answers
47
views
Wordpress Nav Walker Anchor only in li
I have a custom wordpress theme and would like my menu to be a little different than Wordpress standards like this:
<div class="nav-bar">
<ul>
<li>
&...
0
votes
0
answers
461
views
Bootstrap Navwalker parent link issue in wordpress
I see variations on this question have been answered but I am struggling to figure out how to apply to my site.
When I click on a top-level link that has children, I can get it to either toggle to ...
0
votes
1
answer
125
views
Insert div into a menu item before the link and more
I already asked this on https://wordpress.stackexchange.com/ but nobody replied. There are similar questions but I think they are intended for theme developers and not for someone who is simply using ...
1
vote
1
answer
232
views
WordPress how to add <span> after main navigation dropdown
I like to add an empty 'span' in the main navigation li element which has a specific class.
Here is the desired look:
<ul>
<li class="menu-item"><a href="#" class=&...
1
vote
1
answer
98
views
Adding a unique class to level 0 if there is level 2
I really need your help in solving my problem.
I am trying to customize a Wordpress menu using Walker.
My task is to find out at level 0 if level 2 exists. If level 2 exists, then I need to add a ...
0
votes
1
answer
875
views
Add top level menu item title to start_lvl in Wordpress menu walker
I've created a custom WordPress menu using the WordPress walker function. I've managed to do all the necessary HTML I need except adding the top-level menu title to just after one of the divs in the &...
0
votes
1
answer
448
views
Wordpress Bootstrap WP Bootstrap Navwalker icon on the wrong side
I have a Wordpress Bootstrap site. I implemented WP Bootstrap Navwalker for dropdown menu functionality without issues. I followed directions using the provided code examples here: https://github.com/...
-1
votes
2
answers
631
views
Bootstrap 4 Navwalker is not working with bootstrap 5
I am trying to make one wordpress website from scratch in Bootstrap 5, but it seems 'bootstrap4 navwalker' has ended the support for bootstrap 5, however I tried new navwalker but my second level menu ...
1
vote
0
answers
455
views
wp_nav_menu how to wrap whole sub-menu inside div
I'm trying to add div to wrap all submenus inside. Wordpress by default creates menu structure:
<ul id="menu-main" class="menu">
<li>Parent
<ul class=&...
1
vote
1
answer
3k
views
Polylang custom language switcher
How to create a custom polylang language switcher like this https://prnt.sc/vnj7b3 ?
Html markup to be used :
Parent :
<a href="#" class="menu__link language">EN
...
0
votes
1
answer
812
views
Wordpress nav walker - adding SVG arrow icon to parent menu item
This is my code for displaying dropdowns in nav menu. I've found it somewhere in internet and edited. I need to display SVG icon element in parent <li> if has submenu / dropdown menu.
<?php
...
0
votes
1
answer
131
views
Display menu label twice in wp_nav_walker menu WordPress
I want to have two <span> tags inside a WordPress menu as shown in the code below:
<ul>
<li><a href="#!"><span>Home</span><span>Home</span>...
0
votes
0
answers
374
views
Insert an additional <div> after wrapped on navwalker
So I'm having some issues and I can't figure out how to solve them, I've recently started working with WordPress navwalkers and I'm stuck on a particular piece and I can't figure out how to get around ...
0
votes
1
answer
980
views
Bootstrap 4 WP Navwalker Multi-Level Dropdown
Essentially i'm trying to make the WP Navwalker dropdown three levels instead of it's default 2.
I've found tutorials on this but they seem to be for Bootstrap 3 as I don't have the .dropdown-submenu ...
1
vote
0
answers
394
views
How to make a Wordpress Walker Class for a vertical sidebar menu with Bootstrap 4 Accordion?
I'm trying to build my own Walker_Nav_Menu class for a vertical sidebar menu inside my Wordpress Theme. I'm using Bootstrap 4 as a Framework.
My goal is to build something like the following html with ...
0
votes
1
answer
77
views
Apply the navbar-dropdown class to just the first level of a menu
So I'm working on building a Navwalker for WordPress and I'm stuck on one step and I can't seem to figure out how to make this work.
So I have a menu with the dropdown which uses navbar-dropdown.
So I ...
0
votes
0
answers
48
views
Apply dropdown to only main menu then list submenu without dropdown
What is the best way to achieve keeping the first navbar-dropdown but then getting rid all of the trailing levels? So I'd like to keep navbar-dropdown on the main menu hover, but have all the submenus ...
1
vote
0
answers
164
views
Add toogle search form - navwalker - Wordpress
I want to add in my nav a loop icon (font awesome) and if i clck , the search input form display (toggle effect).
In function.php, i add this code :
function add_search_form($items, $args) {
if( $args-...
0
votes
0
answers
508
views
Bootstrap Nav Walker - Hover Drop down stopped working suddenly
My nav was working just fine, when I tried it this morning, the parent nav that has children won't drop down on hover like it did before and also the parent nav links stopped working? Weird. I checked ...
0
votes
0
answers
117
views
Bootstrap navwalker not display nested subcategories
I'm using bootstrap navwalker for a wordpress custom theme. I've added two subcategories to a menù element that is nested inside a main nav element, see the screen. I'm noticing that the two nested ...
1
vote
0
answers
87
views
How to add parent as a submenu <li> item using the WordPress Walker?
Currently, I'm trying to modify the Walker_Nav_Menu class to include the parent element twice as a li item in its submenu.
This is what I'm trying to achieve. I'm not sure if I should modify the ...
0
votes
1
answer
123
views
Add a title <li> before the first <li> of a dropdown with Wordpress Nav-walker class
I am trying to add a new <li> before the first <li> (or <div>) of the bootstrap dropdown, which will be the title of the dropdown. I know there should be a condition on the $output ...
0
votes
1
answer
1k
views
Turning a wp_nav_menu into a foreach loop
I have a customised wp_nav_menu navigation that is outputting a whole list of sub page items from just one echo line...
<?php
$menuParameters = array(
'theme_location' =>'primary',
'...
1
vote
1
answer
813
views
Can we change wordpress custom walker class first (root) ul tag using PHP by overriding The Walker_Nav_menu
Hey guys using the Wordpress Framework usually I create a custom walker that extends Walker_Nav_menu
in order to make a custom wordpress menu. I did register the Menu location in the functions.php , I ...
0
votes
1
answer
282
views
Popper loaded but not working with bootstrap 4 on Wordpress
I am using Popper with Bootstrap 4 on Wordpress and have DataTables and Navwalker. My dropdown menu and the hamburger are not working. Popper is loading but I suspect the order in which the css and js ...
1
vote
3
answers
711
views
How to remove all ul and li, but still keep current-menu-item in WordPress?
I am trying to output through wp_nav this structure through WordPress, but still keep a class for the current menu item, so the tab changes on the current page. (is-active would replace the current-...
1
vote
0
answers
85
views
Access sub-menu description in end_lvl (Wordpress Walker_Nav_Menu)
I'm currently working on a custom WordPress sub-menu; I added some custom html code to it using Walker_Nav_Menu.
I want to access the fields description and attr_title inside the method end_lvl. Is ...
0
votes
1
answer
172
views
WordPress Menus : Remove classes from ul for third level
I am using Bootstrap nav walker
for creating WordPress menus.
What it creates
<ul id="primary-menu" class="navbar-nav ml-lg-auto font-weight-bold">
<ul class="dropdown-menu animated ...
0
votes
2
answers
1k
views
WP Bootstrap Navwalker not displaying 'current-menu-item' class
The li that WP Bootstrap Navwalker generates doesn't include "current-menu-item" class causing me problem styling the current active menu item.
I added the code below in my functions.php file but it'...
1
vote
0
answers
94
views
MS Edge and Internet explorer open nav links on hover without clicking it
A customer reported that the some links on his Wordpress website are being opened when hovered over it. This only occurres on MS Browsers like Edge (Version 14 to 18) and IE.
The theme was not done ...
2
votes
1
answer
175
views
Current level navigation in Wordpress
I have a 3 level navigation:
Home
> submenu1
>> sub3
> submenu
>> sub4
>> sub5 // current page
About
> about2
>&...
1
vote
0
answers
32
views
Hamburger Menu via walker php does not apper
I started to develop my first Wordpress theme. I have some issues with the responsive design. While working on my localhost I had no problem with the main navigation. Now we are online and when ...
0
votes
1
answer
2k
views
Custom submenu nav Walker
I am using a custom nav walker and would like to create a tree menu.
Here is the HTML Structure for the full navigation
<ul class="navbar-nav">
<li class="...
1
vote
0
answers
134
views
How to include WP_Nav_Walker class
I'm using PSR-4 on my classes but when I used Oyic\Utils\Bootstrap_Nav_walker which extends the WP_Nav_Walker class it throws an error that the class WP_Nav_Walker could not be found.
I already ...
0
votes
2
answers
985
views
wordpress bootstrap navigation navbar auto collapse, not in open state
I am developing a WordPress theme and for navbar using a navwalker code,
the problem is when I click on the menu button in mobile it's open and closed in a millisecond. It's working in localhost ...