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
14 views

Class .current-menu-item in custom menu Walker

I'm building a blog using a custom walker for my submenu which looks like this: class Submenu_Walker extends Walker_Nav_Menu { function start_el ( &$output, $item, $depth = 0, $args = ...
7
votes
3answers
106 views

Split up wp_nav_menu with custom walker

I am trying to create a Menu that shows a maximum of 5 items. If there are more items it should wrap them into another <ul> Element to create a dropdown. 5 Items or less: 6 Items or more ...
1
vote
0answers
18 views

How do you add a <div> around the second level of a Menu?

I've been searching around online and reading up on walkers but I can't figure out how to do this. Basically I need a <div class="sub-container"> wrapped around the second level of the menu but ...
0
votes
1answer
60 views

wp_nav_walker that interacts with widgets to setup mega menu

I'm a newbie WordPress developer working on a WordPress theme project that demands mega menus as part of the main navigation. I'm done with the front-end stuff, and now I'm trying to explore the ...
0
votes
0answers
34 views

How to use a start_el variable in start_lvl

On top of the sub-menu list items i would like to insert a <h2>parent-description</h2> line which i expect to show the description (or the title if wanted) of the parent item. Such as; ...
0
votes
1answer
30 views

Modifying the walker to insert parent's description above sub menus

I would like to show the title or the description of the parent item on top of the the sub-menu list items. I have basic knowledge on how to modify the walker by calling start_lvl function to insert ...
1
vote
0answers
24 views

Troubles with Walker_Nav_Menu and closing <ul>

I have an existing site that I am moving into Wordpress. My requirements state that I do not have the ability to change the HTML or CSS. I have a sidebar menu that I am trying to recreate using a ...
0
votes
0answers
12 views

How do can I pass data retrieved from a filter to template files?

I wrote this class to display only the current top level menu item's children: class deseng_navSplit { var $sorted_menu_items; var $args; function __construct($x, $y) { ...
0
votes
0answers
98 views

Add top-level menu post ID to sub-menu

I want to make collapse menu by using walker. I don't understand how to get menu ID from top-level menu. Could somebody can help? Example: menu-item-1 (li) sub-menu-1 (ul) sub-menu-item-2 (li) ...
0
votes
0answers
16 views

Can't add optional class to menu item when using Walker_Nav_Menu

As a wordpress beginner. I'm creating menu also want to customized the <li> tag to be able to assign different class name to control specific behavior through CSS so I use custom walker to get a ...
1
vote
1answer
37 views

Trying to store submenu items to render out after main menu

I'm using a custom nav walker to render out the main menu, during this I want to store the second level navigation items to use/ render out later in a separate area of the page. I want these second ...
0
votes
1answer
32 views

Add custom class to existing menu items from custom meta

I would like to add a custom class to my existing menu items. The problem is, that I would like to do something like this: <li class="<?php echo get_post_meta($post->ID, "_icon", true); ...
0
votes
1answer
30 views

Admin Panel - Disable Moving Selected Terms To Top of Metabox

By default whenever you select a category it moved it to the top of the term list, which in most cases it pretty user friendly. I want to disable this featured and leave my term list in the default ...
0
votes
0answers
7 views

How to make child class use the same signature? [duplicate]

functions.php class themeslug_walker_nav_menu extends Walker_Nav_Menu { function start_lvl(&$output, $depth, $args) { $indent = str_repeat("\t", $depth); if('primary' == ...
1
vote
0answers
90 views

How to add ID and class in nav menu walker?

I would like to set up a custom walker that produces the following output: <div id="navbarHolder"> <div id="navbar"> <ul> <li><a id="nav_about" ...
3
votes
1answer
63 views

Walker class: Problems with understanding how walk() method can be called without error

I am struggling with understanding how WordPress uses the Walker class. In particular, I don't understand the walk() method (I think). First, let me explain what I understood: When calling ...
0
votes
1answer
41 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 ...
1
vote
0answers
76 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
22 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
72 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
59 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
80 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
40 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
41 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
60 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
17 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
85 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
92 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
59 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
175 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
36 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
127 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
121 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
71 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
16 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
87 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
47 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
80 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
78 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
27 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
47 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
445 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
86 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
491 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
58 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
72 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
195 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 ...
2
votes
1answer
458 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
72 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
94 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 ...