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
9 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
37 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
24 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
16 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
16 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
22 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
12 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
16 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
40 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
22 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
28 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
15 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
18 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
118 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
31 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
183 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
38 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
38 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
60 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 ...
0
votes
1answer
141 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
44 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
62 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
30 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
37 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
190 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
79 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
885 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
18 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
52 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
20 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
80 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
67 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
43 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
113 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
396 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
57 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
53 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
926 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. ...
0
votes
0answers
150 views

Custom wp_bootstrap_navwalker file

I got a little problem right here. So I installed the wp_bootstrap_navwalker and it works so far. I got a 3 stage Navigation. The problem is that the navwalker adds the dropdown-menu class to every ...
0
votes
1answer
25 views

Why is only the first operation run in my loop - except for on the last repeat? [closed]

We have a custom walker displaying only the sub menu of the current top menu and while making some changes to it I ran into something I don't get - for some reason only the first echo of each loop in ...
0
votes
2answers
64 views

Page thumbnail doesn't display on navigation

I want to display thumbnail on navigation (using walker) but it doesn't display in the right place. Thumbnails displays only in index.php, before the navigation links and all these thumbnails are ...
1
vote
2answers
63 views

Detecting classes, adding widgets, and adding divs in with a Nav Walker

I've been trying to figure this out for days, to no avail. A template I'm building requires a mega menu. The markup for the menu looks like this: <nav> <ul> <li><a ...
1
vote
1answer
42 views

Make parent page only link to first subpage

I'd like to automatically make any parent page link to it's first subpage if it has one. Like so: Parent 1 (/#subpage-1) Subpage 1 (/#subpage-1) Subpage 2 (/#subpage-2) Subpage 3 (/#subpage-3) ...
0
votes
0answers
227 views

Nav menu custom walker not working in child theme

I have created a parent theme with a nav menu walker that works fine. I want to create a child theme to show small variations to the client. When I put the same code in the child theme it doesn't ...
0
votes
2answers
265 views

Wrapping link and .sub-menu with wp_nav_menu

I want to wrap each sub-menu ul and the tag just before it with a div. I can create the opening tag using the 'before' attribute of wP-nav_menu like this: wp_nav_menu(array( 'before' => ...
0
votes
1answer
82 views

Help with output of post classes using apply_filters

I’m new to scripting, this is a plugin I'd like to modify to output post classes. When I try using: apply_filters( 'post_class', $page->post_class ) it only outputs array=" ". Do I need an ...
0
votes
0answers
12 views

Custom nav walker error [duplicate]

I'm using wordpress 3.9 locally to develop a new theme for my website, however I am getting these errors when trying to use a custom nav walker function: Strict Standards: Declaration of ...
0
votes
0answers
57 views

Getting post content within wp_nav_walker

I have a custom walker set up designed to add content into the nav menu. The problem being that it is not pulling the content. The post object returned by the get_post/get_page has an empty ...
1
vote
0answers
24 views

Get top items number from wordpress menu

I've made a menu in Wordpress backend with 3 levels depth. (4 main tabs with 2 sub level items) I would like to know how I can get the number of tabs created automaticly and add this number to a ...
0
votes
0answers
44 views

Override edit_custom_walker.php to conditionally show input depending on menu position

I've created custom inputs for WordPress nav-menus admin page. I've used a similar technique as is shown in this answer - by duplicating edit_custom_walker.php and adding my own fields. My custom ...