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
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
17 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
16 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
22 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
9 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
61 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
26 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
25 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 ...
0
votes
1answer
25 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
62 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 { ...
2
votes
2answers
79 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
135 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
43 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
27 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
39 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 ...
1
vote
1answer
164 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
42 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
13 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
31 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
28 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
308 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
44 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
146 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
19 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 ...
1
vote
0answers
118 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
56 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
25 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
55 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
32 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
162 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
42 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
15 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
79 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
65 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
22 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
25 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
154 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 ...
0
votes
1answer
240 views

Custom nav walker with different output depending on depth

I am trying to redevelop a HTML site as a Wordpress theme, and the HTML menu is as follows: <ul> <li class="current"><a href="#"><div>Home</div></a></li> ...
1
vote
0answers
35 views

Change submenu markup

I've seen people recommending to edit the wordpress default Walker to change the menu markup and create your own. The problem with this is that I would like to change the markup of the submenu and ...
0
votes
0answers
22 views

Walker Menu with Parent, Children, Children

This website has the menu I have been working on I used the suggestions from a question that was posted about a walker menu and it really helped and the site no longer crashers and the menu ...
-2
votes
1answer
39 views

how can i get the page_ID in nav li [closed]

I need a menu with the page IDs of the linked Pages in the li Tags. It should look like that: <ul id="menu"> <li class="pageid_23"><a href="page1">Page 1</a></li> ...
0
votes
0answers
23 views

How to separate a nav with child levels into full length menus?

I am using the wordpress underscores theme taken from https://github.com/automattic/_s I have tried to use a custom walker but am getting confused with it. All I want to do is create a list of links ...
0
votes
1answer
101 views

Extend Menu Walker Output

I've found a custom Menu Walker on the Internet that was perfect for my multilevel menu. It fitted almost like a glove. I've made some tiny improvements but now I need to limit the number of ...
0
votes
1answer
88 views

Using wp_list_categories or other function inside a menu walker?

I'm new to messing around with menu walkers in WP, so I might be trying to do something that's not possible, I'm not sure. What I'm trying to do is insert a div containing a list of my product ...
0
votes
1answer
149 views

Walker_Nav_Menu Add Strings and Class Name

How to make this pattern using Walker_Nav_Menu? <ul class="nav navbar-nav"> <li><a href="portfolio.html">Portfolio</a></li> <li class="dropdown"> ...
0
votes
1answer
38 views

Creating custom Menu for custom theme

I want to create a custom menu for my theme. The default menu architecture created by wordpress wp_nav_menu() function is made by <ul> <li> tags. But my custom Menu architecture is: ...
0
votes
1answer
145 views

has_children in custom nav_walker

I am trying to create custom menu nav walker. I added below code function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) { $id_field = ...
0
votes
0answers
129 views

How to add number of post to category menu items

I wanted to know how we can add number of posts for dropdown menu items that are categories. For example: Topics Category 1 (5) Category 2 (8) Category 3 (2) More Topics Category 1 (5) ...
1
vote
1answer
177 views

Indirect modification of overloaded property WP_Post::$classes has no effect

I'm working on a child theme and while everything works the Walker_Nav_Menu and Walker classes are causing all the fuss. My parent theme overrides Walker_Nav_Menu as below: if ( ! class_exists( ...
0
votes
0answers
86 views

Need help to build a menu with WP_NAV_MENU function

I have a markup where using table tag for menu creation. This is quite simple but noticed when multiple submenu exist then structure is changed. In this case i don't get any appropriate way to build ...