The Walker class was implemented in WordPress 2.1 to provide developers with a means to traverse tree-like data structures for the purpose of rendering HTML.

learn more… | top users | synonyms

0
votes
0answers
22 views

Convert responsive <ul> menu to <select> for small screens sans JS

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 ...
0
votes
0answers
7 views

there are two items in two different sub menu when i click on any item from them it redirect to the last item of menu in wp nav menu

I have big menu in this two items which is same and its is ina different sub menu. when i click on any item from them it redirect to the last item of menu. using wp_nav_menu walker... please tell me ...
0
votes
0answers
22 views

how to adding css classes when it has 2 level children true wp nav_walker

I need to create a website true bootstrap 2.3.2 ( cause of sub-menus). and it has 3 or 4 level in menus. <div class="nav-collapse collapse"> <ul class="nav go-right"> ...
1
vote
0answers
25 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
0answers
38 views

Custom_Walker_Nav_Menu is repeating my navigation menu in wordpress

I am converting HTML Template to wordpress theme. I almost convert everything expect my navigation menu. I want exact same navigation menu that is in my HTML Template. I searched a lot on how to ...
0
votes
0answers
22 views

customize exisiting wordpress menu item

For a school project I am trying to manipulate the existing primary menu with a plugin. The result should be: if the plugin is activated, it edits the 'Login' button to be conditional: if something ...
0
votes
1answer
35 views

How to add odd and even classes to all nav links through walker?

I kept finding posts that explain how to add even and odd classes to sub-menu items, but can't seem to find how to add it to the main menu items that do not have sub menus. I've already checked out ...
0
votes
1answer
15 views

Output sort number in wp menu list item?

I want to output the sort number of the list item in it, in the wp menu. No, not by using ordered list <ol>. I have tried search for answers about this by searching on wp forum an reading the ...
0
votes
0answers
23 views

How to add specific menu items to specific sub-level <td> with walker?

I want create a megamenu with four columns on 2nd level submenu (inside div and table). When I add class col1 to menu items, display them inside <td id="c1"> and when I add class col2 to menu ...
-2
votes
1answer
32 views

How to add attribute in menu code

I want to make a menu with hover animations. My HTML syntax looks like this: <ul class="menus"> <li class="current"><a href="#" data-hover="Home">Home</a></li> <...
2
votes
0answers
20 views

Render Selected Categories in Admin Edit Post Screen differently

Selected Categories for a post in the admin screen are rendered by: // Put checked cats on top $output .= call_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) ); ...
5
votes
2answers
62 views

WordPress 4.4+ breaks Walker Extension

I upgraded WordPress to 4.5.1 from 4.2.2 and it has broken the functionality I have extending the Walker class. The Walker extension: class ReturnWalker extends Walker{ public $db_fields = array( '...
3
votes
1answer
41 views

Pass a parameter to a menu walker

Is there any way to pass a parameter to a menu walker? I'm trying to write a BEM-style walker, and I'd like to be able to pass a class to apply to the menu links via the walker. Something like: <?...
0
votes
0answers
13 views

Nav walker class error on WordPress update [duplicate]

I updated my WordPress to Version 4.5 yesterday, and the below warnings were show Warning: Declaration of Walker_Nav_Menu_Dropdown::end_lvl(&$output, $depth) should be compatible with ...
0
votes
2answers
35 views

How to request container_class from wp_nav_menu

I'm currently trying to setup a custom nav walker that will use container_class from the menu as a prefix for the class names of the list items and children. $defaults = array( 'menu' =>...
0
votes
1answer
29 views

Custom menu with Walker class - what should the $db_fields be?

I'm trying to create my own custom menu using the Walker class and in the process of trying to figure out what's going on, I'm attempting to reproduce what wp_nav_menu() does by default, so, I've got ...
1
vote
1answer
54 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
17 views

Customer nav menu walker for post type and taxonomy archives

Walkers have the least documentation that I'm able to find, so I've come here to ask how to achieve placing items attached to categories as sub-menus. Let me explain: I have a simple menu that ...
0
votes
1answer
72 views

Assign different category colours to different categories in the main menu

I have created a colour picker field with ACF which shows on every category page and allows the end user to assign a colour to each category. This is working well but I would like the categories on my ...
0
votes
3answers
31 views

Cannot add home page url to menu with #

I am adding a #section as a custom link to my menu, because I want to scroll to that section when I click on that link. When I'm on the home page, this works fine (the section is on the home page), ...
0
votes
0answers
47 views

how to made customize wp_nav_menu walker with search box

how to made customize wp_nav_menu walker with search box. <ul class="main-navigation"> <li class="course"> <!-- <a href="#">Course</...
0
votes
1answer
38 views

Where to implement custom walker class?

I have created a custom walker class for changing the output of menu items. Where do I place my custom walker class file at? I have tried to ask on the Wordpress forum but it has gone 3 days with no ...
0
votes
1answer
112 views

New walker for walker_nav_menu to change inside container data

I'm not really good with coding, but I have googled a lot and edit some script and it worked, but I can't achieve what I need. This is the code: class description_walker extends Walker_Nav_Menu { ...
4
votes
2answers
205 views

Comment Walker vs. Comment Callback

I've been messing around with custom comments this week and I'm trying to figure out when I'd want to use a walker and when I'd use a callback... There's some things I can't quite figure out how to ...
4
votes
1answer
343 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
vote
0answers
96 views

Main Menu and Sub Menu Items for Footer

So I'm currently trying to figure out how to display both my main menu items and my submenu items separately in my footer. I want to display them both in separate columns (bootstrap) and am having ...
1
vote
0answers
31 views

custom walker class

I'm trying to make a navigation that has a similar structure of this website: https://grannys.ca/ But I got struck in the logic of how can I implement an if statements which determine several things: ...
1
vote
0answers
43 views

Custom navigation structure with walker class

I'm trying to make the navigation with different structures using walker class but I got stuck. Here's the code of what should the html output <nav class="main-nav"> <div class="...
1
vote
1answer
317 views

add span class and i tag inside wp_nav_menu link anchor tag

I found examples adding a class to top level items, so we can display an arrow in menu items with sub-items, but is seems terrible to cope with the already built in WordPress classes, can't display ...
1
vote
0answers
54 views

Create menu / submenu from category subcategory and posts

I have a custom menu made up of pages and categories and I am trying to output the category and subcategories as well as the last 4 posts from each category/ subcategory. In trying to use a walker ...
1
vote
0answers
14 views

Navigation doesn't render when wp is hosted

I have created a theme on my local host and it works fine. I am using the walker function in order to get the bootstrap navigation. However when I upload the site on godaddy the navigation doesn't ...
1
vote
0answers
42 views

CSS_Menu_Walker not showing on mobile view?

I found this example on perishable press. My menu works fine and all the submenu items display properly. For some reason, when scaled below 769px, it disappears. I figure it's CSS, but I can't make ...
0
votes
1answer
35 views

Show post titles within Wordpress bootstrap Dropdown menu

I created custom bootstrap navwalker class for my wordpress theme all things work correctly i has this code below within function start_el(){} When i put <h2>Hellow World!</h2> within $...
0
votes
2answers
428 views

wp_nav_menu add class to child item with sub child

I need your help, am trying to add class dropdown-submenu to a <li> element which has children. Not sure if I was clear enough, so here is an example: |-Home (Parent Item) |-Services (...
1
vote
1answer
61 views

Get number of root elements in walker class

I extended Walker_Nav_Menu class as below class YPE_custom_navwalker extends Walker_Nav_Menu{} I want use the get_number_of_root_elements( $elements ) function that place in to Walker class within ...
0
votes
0answers
261 views

Extending Nav walker with Yamm menu

Here is my navigation code where only service tab should have col wise layout of menu. I am using bootstrap nav walker menu which is working fine for other nav except services menu which should have ...
0
votes
2answers
28 views

Set custom id to list element walker custom function

I am creating a navigation with bootstrap in a custom WP theme. I have managed to get this result: <li id="menu-item-27" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-...
1
vote
0answers
149 views

Custom Navigation build using wp_nav_menu and walker

What I have Right now I have an old template in plain HTML. In there I use a custom Navigation menu built like this: <div class="collapse navbar-collapse main-menu main-menu-1" id="main-menu"> ...
0
votes
0answers
79 views

How to divide wordpress menu with sub-items on two ul's (using Walker Class)?

There is a great answer http://wordpress.stackexchange.com/a/36407 for splitting menu on two, and there are other great examples on web explaining how to do this, but no answer explains how to do this ...
0
votes
0answers
28 views

Accordion Menu not being called

I'm trying to add a vertical accordion menu to my custom theme, and I have no idea what is not working. The original tutorial is here : http://cssmenumaker.com/blog/wordpress-accordion-menu-tutorial ...
0
votes
1answer
84 views

How can I make wp_nav_menu() support <br> tags?

Static webpage created nav menu separating titles using <br> tags, but when I'm converting the site into WordPress I'm missing <br> tags there. How can I enable using <br> tags in ...
0
votes
0answers
40 views

How to create a custom walker class to replace the href with hashtag slug?

I was wondering how I can achieve the possibility to replace the default WordPress menu links with #slugname. How should a simple walker class should look like to achieve this? I came up with this: ...
0
votes
1answer
316 views

Counting top level items in a custom menu walker

I am creating a split menu (half the items on the left, logo in the middle, remaining items on the right). I don't really understand Walkers all that well, but I found this code snippet. This was ...
1
vote
0answers
56 views

Extend Walker Class for 2 checkbox taxonomy selection?

I am working on an add-content front end form (posts in this case). I am able to display, and add, categories and taxonomies to posts correctly with the following: <div class="checkbox"> &...
0
votes
0answers
18 views

Add parent link to its submenu

How to add parent link to its sub menu in navigation bar? I mean any hook, filter or custom navigation Walking? You may know, this problem is coined from the feature of mobile menu, I cannot go to ...
0
votes
2answers
125 views

How to Add support for sub-menu item description in wordpress?

I am working on a Custom Nav Walker and I want to use Description field in wordpress menu in my theme. The field works fine as far as for First Level Menu items but when I add something in sub-menu ...
0
votes
0answers
75 views

Dropdown menu with Foundation 5

I've had a heck of a time getting Foundation dropdown menus to work. I've got the menu itself together but can't figure out to integrate Foundation's needs for formulating dropdowns to the Walker. ...
0
votes
1answer
35 views

Is it possible to separate all submenu items?

I'm using FoundationPress as a starter theme and I'm trying to separate the submenu. My theme basically generates menus like this: <ul> <li class=" first-level has-dropdown"> &...
0
votes
0answers
32 views

Get parent item using Walker function

When using the Walker function I found out that the $item parameter contains the properties current_item_ancestor and current_item_parent but both are empty in all cases no matter if its a menu or a ...
2
votes
1answer
176 views

Custom Walker anchor tag not inheriting attributes

So I am just now learning and playing with custom walkers and I came across this really helpful Stack Overflow question. So I implemented the answer in that answer and added this to my functions.php ...