Questions tagged [wp-nav-walker]
116 questions
70
votes
15 answers
How to add Class in using wp_nav_menu() in Wordpress?
I am using wp_nav_menu($args) and I want to add my_own_class CSS classname to the element.
I'd like to get the following result:
Link
How to do that?

Ayyaz Zafar
- 2,015
- 5
- 26
- 40
27
votes
6 answers
wp_nav_menu - add class on UL
I am learning wordpress together with bootstrap and somehow I can't add class on UL tag.
In the screenshot, I want to add class nav nav-tabs on UL but it was added on parent div
$defaults = array(
'menu_class'=> 'nav nav-tabs', …

JunM
- 7,040
- 7
- 37
- 58
5
votes
2 answers
Bootstrap 4 navwalker - multilevel menu
I'm using this nav walker in my Wordpress project. I want to create multilevel menu, for example. What I need to change to get it work? Or maybe is it another walker for BS4 with multilevel menu support?
Menu Item
- Sub menu
-- Sub menu item
-- Sub…

MMPL1
- 533
- 7
- 21
3
votes
3 answers
Two-part Bootstrap navigation menu with logo in the center
I am making a dynamic wordpress links in navigation bar using nav_walker. How can i implement center something like this in wordpress…

Jc John
- 1,799
- 2
- 34
- 69
2
votes
1 answer
Current level navigation in Wordpress
I have a 3 level navigation:
Home
> submenu1
>> sub3
> submenu
>> sub4
>> sub5 // current page
About
> about2
>> sub6
> about3
>> sub7
I am trying to get each…

Luc Laverdure
- 1,398
- 2
- 19
- 36
2
votes
0 answers
WordPress - Display categories, duplicate parent item and show as a child if there are children
I'm having issues with customising the Custom Walker.
What i'm trying to do is create an accordion menu where the first parent opens up the child list which also as the parent repeated so it can be clicked on.
Parent 1
- Parent 1
- Child 1
-…

ragu.design
- 23
- 4
2
votes
1 answer
Issue on Adding A Class to Bootstrap Navbar Walker Dropdown in WP
Using Bootstrap 3 and Navbar Walker I am able to create dynamic dropdown on the Bootstrap and WP template but I need to add .dropdown-menu-left to the .dropdown-menu class, as well.
As you can see I tried this by addig this line
'dropdown_class' …

Behseini
- 6,066
- 23
- 78
- 125
2
votes
1 answer
Template part not appended after menu element
I am using the wordpress walker class to append a template part after a menu li, however it is injecting the template parts above the entire menu structure. Here is what I've got
class bt_menu_walker extends Walker_Nav_Menu
{
public function…

Chris
- 767
- 4
- 8
- 22
2
votes
1 answer
Convert responsive WordPress menu to
I'm trying to build a responsive header for my WordPress theme on my site. Depending on the screen resolution, I'd like to go from a typical WordPress unordered list menu (larger screens), to a custom select dropdown menu (phone screens). I'd like…

Digital Brent
- 1,275
- 7
- 19
- 47
1
vote
1 answer
Get Category name in Wordpress Walker Nav Menu
I Write a Custom Nav Walker in My Wordpress Custom Child Theme.
I Need To Detect Current Category in my end_lvl Function. Is there Any Solution ?
function end_lvl(&$output, $depth=0, $args=null) {
$indent = str_repeat( "\t", $depth );
…

Sepehr Mahvash
- 11
- 2
1
vote
1 answer
WordPress how to add 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:
-
Nadam
- 39
- 1
- 6
1
vote
1 answer
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 unique class.
The only thing I was able to find out…

Elizaveta Krasova
- 13
- 3
1
vote
0 answers
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:

Alicja Grabska
- 23
- 9
1
vote
1 answer
Polylang custom language switcher
How to create a custom polylang language switcher like this https://prnt.sc/vnj7b3 ?
Html markup to be used :
Parent :
EN

Ion T
- 119
- 1
- 9
1
vote
0 answers
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 the Walker class.
-
…

ilfedevisio
- 31
- 7