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
1answer
21 views

Custom nav walker: How to acces the $args parameter?

I am creating a custom nav walker. I noticed that the nav walker class from the WordPress core is written rather rough – much of the stuff going on could be spread out through various methods, so I ...
0
votes
0answers
24 views

Page content loading issue using Walker_Nav_Menu

At each page refresh, the page loads in steps, first the header with main menu and then after 1 second, the page loads the rest of content. I use the following code to display the a mega menu on my ...
1
vote
1answer
13 views

Wordpress empty Nav Menu error

i have created Multisite. i have assigned menu for the first sub domain while for the second sub domain i have not assigned Menu. i just enabled the Debug mode and got Following error: Notice: ...
0
votes
1answer
19 views

Add Thumbnail to wp_list_categories()

I'm using the following code to display a list of my taxonomy terms in my home page: $customPostTaxonomies = get_object_taxonomies( 'guide' ); if( count( $customPostTaxonomies ) > 0 ) { ...
0
votes
1answer
35 views

How does the Walker class works?

Can someone explain me how the walker class works and does the methods inside the class always needs to overload the parent method?
0
votes
1answer
24 views

wp_nav_menu - page template name as item class

Is there any way to display template name (or page-template.php filename) in each menu items' class? Maybe using wp_nav_menu walker? Specifically, I'm using standard menu call: wp_nav_menu( array( ...
2
votes
1answer
28 views

Add custom html to nav_menu

Im trying to add some html to the nav_menu. Basically I need a button tag inserted after the opening li tag if there are children in the menu. I see that there is a walker class but I have no idea on ...
0
votes
0answers
15 views

Can't get nav_walker class to recognize pages with children

I've built a walker class and I've got it doing everything I need except inserting a single div tag. In the start_el there is an $args>has-children that works and adds a div tag before top level ...
0
votes
0answers
42 views

Dynamic multi column menu

I have a dynamic menu where the submenu is based on specific content from the page. With help from Uruk on the this thread We(he) made it work. What I realise now is that if a page contains a lot of ...
0
votes
0answers
11 views

Format Specific Link in wp_list_pages

I am implementing a custom walker for wp_list_pages. I would like to implement the following logic inside the walker: IF PageID=X THEN use output A IF PagID=Y THEN use output B. The code of my ...
1
vote
1answer
53 views

View h2 content tags of a page in sub menu

I think I'm trying to do something unusual I guess because I can't find it anywhere.I want to have a submenu base upon content off the associated page. e.g. In my menu there is a menu-item called ...
0
votes
1answer
46 views

How to construct a custom html for submenus

How to write a walker class for constructing a new submenus. for my wordpress theme the submenu is looking like this: <li class="drop"> <a ...
0
votes
0answers
32 views

Use Walker_Nav_Menu to remove automatically generated classes but keep user-added classes

My custom nav walker is outputting link elements like this: <a class="test-page-class menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-4 ...
0
votes
2answers
87 views

Add dynamic content block to nav section generated by custom walker

I am working on a theme that requires a piece of dynamic content nested in the navigation. I'm using a custom walker to generate the menu. I need a way to add markup to the code that will be editable ...
1
vote
1answer
34 views

List pages to show only Whitelisted sub pages

In my custom theme I want to show all parent pages but for a few of those parent pages I don't want to show their subpages. I know you can add all these subpages to the 'exclude' argument of the ...
0
votes
1answer
69 views

How to get selected taxonomy or category ID if using custom walker?

I'm building a taxonomy->child taxonomy dropdowns where the child will only be active if the parent is selected. Everything works great, except that I'm using wp_dropdown_categories for the parent ...
0
votes
1answer
67 views

How to add scroll IDs to WordPress menu anchors

In my theme the top menu is like this: <nav> <ul> <li> <a class='active' data-scroll-nav='0'>Home</a> </li> <li> ...
0
votes
0answers
49 views

Custom menu walker: Repeating a menu item when it has children

I am trying to repeat a menu item when it has children. To better understand, maybe take a look at this example markup: <ul id="main-nav"> <li>Item 1</li> <li ...
0
votes
0answers
15 views

How to create new options within the menu?

I have created a custom menu using the walker class which was fairly simple but for the life of me I can not work out how to add options to the navigation item. For instance I am wanting to make a ...
1
vote
1answer
35 views

Check what “type” a menu item is

The question I would like to check what type of menu item each item in my menu is i.e. is it a Page, Category, or Custom link. What I want to achieve I want to create a menu made up of categories ...
0
votes
0answers
43 views

There is a code that I don't understand - menu customize with walker

Here is a code I got from internet: (of couse I do not own it) class description_walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global ...
0
votes
0answers
47 views

Extending Walker_Category class

I would like to show category images on each of my custom categories. So far I've managed to echo the image url within the walker class by adding this piece of code into the existing walker_category ...
0
votes
1answer
48 views

WP List Pages - Add Title Attributes to Anchors

Using the default wp_list_pages() is there an easy way / filter to add title attribute to the anchors? Right now it just spits out the anchor with no title attribute but I would like to add it on ...
0
votes
1answer
20 views

child comments not displaying as nested

I'm having some trouble getting my comments to display as nested from other comments. My current max level of depth is set to 5 through the wordpress admin panel, but all my comments appear on the ...
1
vote
0answers
35 views

cannot grab post meta from extended Walker_Category class properly

Trying to show some custom post meta inside an extended Walker_Category class. I am very inexperienced with Object Oriented Design so this issue is quite difficult for me to solve I am essentially ...
1
vote
0answers
268 views

Use custom walker to add taxonomy terms to main nav menu

I created a Custom Post Type: Product and a Taxonomy assigned to it: Products So under that Taxonomy I can add different types of products (terms if i'm not mistaken). When adding new products I get ...
0
votes
0answers
67 views

Nav Walker: Set ul id to current item's title

I'm trying to assign an ID to a sub-menu ul that matches the associated items li in my nav-walker. Here's the output I'm looking for: <ul> <li> <a href="menu-item-1" ...
0
votes
0answers
340 views

Walker to add Bootstrap markup for wp_list_pages

I'm using wp_list_pages() to create a nav of the pages in my site. Some pages have children so I need a dropdown menu in the nav to show the child pages and the Bootstrap markup for dropdown menus. ...
0
votes
0answers
45 views

Walker Nav Menu - down arrow for top level, but right arrow for below

I'm using Donald Harvey's solution with Custom Walker_Nav_Menu to show an arrow where submenu items belongs. It worked for me in a project where I had a left sidebar vertical menu. But when I'm ...
0
votes
0answers
60 views

Alter menu item parent relationships with walker?

An example custom menu structure I would like users to see About Interests - Movies - Toys - Fun Job Hangouts The end result outputted menu ready for dropdownage would be About - Interests - ...
0
votes
1answer
107 views

How to remove dropdown from wp_nav_menu

I dont want to have dropdown (select - options) in my wordpress menu, even in mobile or lower width devices. I know I can use css to hide it, but I want to remove it at all. I googled for an hour and ...
1
vote
1answer
284 views

Check if wp_nav_menu items have submenus

I'm looking to output the following markup for a menu through wp_nav_menu, <ul> <li><a href="/">Home</a></li> <li> <a href="/" ...
1
vote
0answers
54 views

Get Parent List Class for Child Pages Using Walker

I'm having trouble getting child pages to use the parent li class whilst using wp_list_pages(). I'm using a walker to get the list classes to use page title, but no matter which way I try, I can't ...
0
votes
0answers
77 views

Limit to One Custom Taxonomy Selection, Including Most Used

I've got a bit of code that limits my custom taxonomy to only allow the user to select one category, by turning the checkboxes in to radio buttons. See the screenshot below for example: I need the ...
0
votes
0answers
48 views

Extending the walker class to add a top level list item to the nav menu in a different order

I've seen functions to append to the beginning or the end of the menu, but how do I add this list item right after the first? So it would come second in the menu order. Is this possible? If so, how ...
0
votes
0answers
49 views

Why is the Walker_Nav_Menu self closing tags added in start_lvl

I'm creating a custom Walker based on Walker_Nav_Menu for a megamenu I'm working on and the issue I'm having is that it seems the tags I open on start_lvl are being automatically closed. Here's my ...
1
vote
1answer
211 views

Run a filter when a walker runs

Is there any way to run a particular add_filter function whenever a specific Walker_Nav_Menu class runs? The function always needs to run when the walker goes, and I'd like them to share variables, in ...
0
votes
1answer
142 views

Extend walker - navigation, adding data attribute to a tag

I would a data attribute to the a tag in the menu, like have <a href="#example" data-attribute="attribute">CLICK</a> I know that I have to extend the Walker BUT I tried in several times ...
8
votes
1answer
1k views

Mega Menu Walker

I'm trying to create a mega menu walker. Unfortunately, walkers completely escape my coding knowledge. I could really use some help getting it working. Here's the features I need: Wrap the ...
0
votes
0answers
25 views

Walker only returns one child page

I'm trying to create a menu on a page showing all of its sub-pages. I want to add an image to the link so I'm using a walker to edit the output of wp_list_pages. But when I call the walker only the ...
1
vote
1answer
66 views

Insert HTML inside link in a walker

I've got a custom nav walker that (theoretically) pulls the featured image from the most recent post in a custom taxonomy, and displays the the image after the link in a wp_list_categories. The ...
0
votes
0answers
22 views

Regarding Wordpress Post, reply tree view

I want to make post/reply tree view in my admin panel so anybody can guide me which is best way to do that. I am using custom post type, custom post category and also added meta values to added post ...
0
votes
1answer
105 views

Term Checklist Walker - Disable Parent Categories

Currently I have a structure where the top level categories are acting like landing pages, so they should have no posts directly assigned to them. What I would like to do is disable the top level ...
0
votes
0answers
85 views

walker_category doesn't walk?

I'm trying to use the walker_category class in order to modify the HTML output of the wp_list_categories for several custom taxonomies, but the walker doesn't seem to 'work the tree'. Here is my ...
0
votes
1answer
48 views

Horizontal Navigation

Hi. I been fighting with this problem for couple of weeks now. Trying various approaches. From CSS styling to a custom walker. I want to render each level as its own element. The navigation ...
3
votes
2answers
124 views

Adding Post Counts to Menu (Nav) Programmatically?

I'm fairly stumped on this. Without getting too query-heavy, I was wondering what path one might take to produce a menu that links to a category of posts, and displays in parenthesis how many new ...
1
vote
1answer
560 views

Change an li class name in a wordpress custom menu walker

I'm building a nav that has a class applied to the main LI's and the nested LI's. Example: <ul> <li class="className">Test</li> <li class="className">Test <ul> ...
0
votes
0answers
75 views

Walker_Nav_Menu - creating separate menu for current top level item children

I have had hard time making wordpress custom walker work as I want and I think the problem might be somewhere else. I have a nav tree which looks like this: What I want to do is to have two ...
0
votes
1answer
77 views

Use wp_nav_menu to display ALL pages

I am currently building a wordpress theme. For the menu, I just want to display all the pages that are created in the order that they are created in (i.e. I don't want users to have to go into the ...
0
votes
1answer
2k views

Custom Nav Walker sub-menu HTML construct

I've got my Custom Nav Walker set up and it works fine with the main menu items, and displays them how I want. However the same HTML is being applied to the sub-menu elements which isn't what I want. ...