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

Specific Page that convert Hyperlink to anchor in nav menu

I extended my Walker_Nav_Menu that converting hyperlink to anchor as I'm making one page website. Here is the code: class description_walker extends Walker_Nav_Menu{ function start_el(&$output, ...
0
votes
1answer
18 views

Walker Class: Output Parent Description and Featured Image right after sub-menu?

I've looked around everywhere but I can't seem to find an answer to this specific case. I am attempting to output the parent description and featured image of the page right after the sub-menu ...
0
votes
0answers
28 views

Random menu and nav_menu_walker

help me understand. I created a random menu: After I call random menu widget The problem How to make a display of the number of records in a random menu? How can we create through Walkera? ...
0
votes
0answers
15 views

Walker_Nav_Menu check if menu has parent

I created a custom function extending Walker Menu and having some few issues. I got a post from https://wordpress.org/support/topic/how-do-i-know-if-a-menu-item-has-children-or-is-a-leaf showing me ...
-1
votes
0answers
20 views

Walker Class Usage

I am building a wordpress website with drop down menu (sub menu). To achieve this here I am using wordpress walker class. This is the code which I am using in my functions.php class ...
0
votes
1answer
79 views

Remove current class from sub menu items

I am building a wordpress website with drop down menu (sub menu). To achieve this here I am using wordpress walker class. This is the code which I am using in my functions.php class ...
0
votes
0answers
23 views

WordPress Page Walker class descendants of parent with thumbnail and custom classes

Please, help! I'm at my wits end and have to finish this by tomorrow, so I would REALLY appreciate any help with adjusting this page walker class. (Please!) The ultimate goal is to display a list in ...
2
votes
1answer
45 views

Create self-populating menu and add extra divs to the menu layout

What I'm trying to achieve: A menu with one level of sub-menus: PAGE 1<br> --- Page 1 sub-page 1<br> --- Page 1 sub-page 2<br> PAGE 2<br> --- Page 2 sub-page 1<br> --- ...
0
votes
0answers
34 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 = ...
10
votes
4answers
297 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
21 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
78 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
46 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
59 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
37 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
13 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
171 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
36 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
60 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
50 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
42 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
129 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
71 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
48 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
103 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
29 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
125 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
74 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
123 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
43 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
50 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
67 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
20 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
101 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
131 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
84 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
221 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
192 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
160 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
93 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
17 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
111 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
48 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
99 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
109 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
29 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
53 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
528 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 ...