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
7 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
9 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
13 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
10 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 ...
1
vote
0answers
13 views

Walker_Nav_menu access parent menu name

I extended Walker_Nav_Menu with the code below and I would like to replace [TITLE HERE] with the name of the parent menu... In my menu I only display one depth of the navigation at a time. So I would ...
1
vote
0answers
11 views

Rendering of custom walker menu function not working properly

I have a custom function for my nav walker menu that adds custom php/html to it, which can be seen below. It renders a twitter bootstrap dropdown menu that I would like to put my login form in. ...
0
votes
1answer
22 views

Customize Walker_nav_menu to show posts if item is category

I would like to customize the nav menu walker so that when it encounters a category it automatically makes the 5 most resent posts children of the menu item. Is there a way to dynamically add items ...
1
vote
0answers
26 views

Can I use multiple nav_walkers?

I am working on a project and I came to the conclusion that I need to use 3 nav walkers: one for edit and 2 for HTML formatting class MY_Walker_Nav_Menu_Edit extends Walker_Nav_Menu {} // this ...
0
votes
1answer
24 views

How to add a element with walker menu right after begin of the navigation tags?

I was trying to add a element right after begin of the navigation tags and before the ul will start. So add a element directly after opening nav tag. I tried this, but this will add a list item after ...
-1
votes
1answer
17 views

Custom walker pulldown display current page

I have this pulldown menu and when I go to a page with this pulldown menu, I want that the current page is showed in the pulldown menu. I've searched in the documentation but can't find any. class ...
0
votes
1answer
40 views

Add login hyperlink to secondary navigation menu

I have the following lines of code in my functions.php file: #-----------------------------------------------------------------# # Custom menu ...
0
votes
0answers
14 views

Get parent menu item id on submenu ul using start_lvl [duplicate]

I'm struggling with the Walker_Nav_Menu. In the start_lvl function, where I create the <ul> tag holding my submenu, I want to insert the item ID from the parent menu item. I know that I can ...
0
votes
0answers
35 views

Split into two seperate unordered lists with custom walker

So I am trying to create a mega-menu using a custom walker through Wordpress. So far I have this for the walker: class oe_walker extends Walker_Nav_Menu { /** * Specify the item type to ...
0
votes
0answers
44 views

Adding 3rd level in custom walker

at present my custom walker works great :) but I can for the life of me get a 3rd level to appear... I can get the top level and the 2nd level dropdown to show perfect, but how do I achieve a 3rd ...
0
votes
0answers
47 views

Need a conditional div in custom Walker function for wp_nav_menu()

I have used wp_nav_menu() for my custom WP sites with Custom Walker Function which is working fine and providing me below output: <div id="navbar" class="navbar-collapse"> <ul ...
0
votes
0answers
41 views

How to add class to parent a tag with a sub menu

I have been trying to add a class to the parent a tag of a sub menu using a custom walker. The current walker I am using adds the class to the parent <li>, does anybody know how to adjust this ...
0
votes
0answers
65 views

Custom Walker function need to customize in a specific way for wp_nav_menu in Wordpress

I have used wp_nav_menu() for my custom WP sites with Custom Walker Function which is working fine and providing me below output: <div id="navbar" class="navbar-collapse"> <ul ...
4
votes
4answers
122 views

Any walker causes blank menu?

Using the following, or any other custom Walker_Nav_Menu seems to cause a blank navigation menu, I tried specifying the default to make sure I wasn't going crazy yet it still blanks the output... Any ...
0
votes
0answers
35 views

Customizing Walker_Nav_Menu - Trunicating spaces

I've just started learning to code WP themes pretty much from scratch and I'm trying to figure out how to pass a variable thru a customized Walker_Nav_Menu but without any ascii spaces. The goal is ...
0
votes
0answers
30 views

Wordpress menu walker - get the parent item

I want to implement a menu walker system where only those submenu items get listed which have a specific parent. So let's say I have two level one menu items, A and B. On a page I want to get listed ...
1
vote
1answer
50 views

Use menu class in walker function

Is there anyway, using the custom menu css classes that are turned on in the option, to apply those via a walker function to the span instead of the li's? My custom walker: class ik_walker extends ...
1
vote
1answer
89 views

Custom walker nav - Add sequential number as class

I'm getting to grips with the walker at the moment, but i need some assistance in getting my desired effect. My walker function looks like: class ik_walker extends Walker_Nav_Menu{ //start of ...
0
votes
0answers
13 views

Walker customization - submenu & HTML description

I'm working on a site created by another person who used this customization to display a HTML description (img) in the menu. Now, I'd like for only a menu item to display the subpages, but I can. ...
0
votes
0answers
76 views

creating a custom walker class

I am currently developing a theme for wordpress, and would like to add some data values to the list items that are returned. Here is the basic structure of my nav: <div id="nav" class="grid_9 ...
0
votes
1answer
108 views

Editing or filtering the output of the Genesis navigation

I'm trying to edit or apply a filter to the default Genesis navigation genesis_do_nav Currently I'm extending a Walker class to add a <span> with data-attribute around the navigation's link ...
0
votes
0answers
32 views

walker class for custom menu structure

i design a html template for hospital website and my menu structure is like this: <div class="innerW"> <ul class="clearfix"> <li class="tN nav1"> <a ...
1
vote
1answer
74 views

Walker nav remove submenu ul from a certain depth

I want to remove sub-menu ul and .menu-item-has-children class when the menu depth is superior or egal to 2. So, I only want a menu with 3 sub-menu at maximum. Other item children will still ...
1
vote
1answer
34 views

Removing <li> from Comment

I'm making a custom comment template, and I do not wish to use a list to display comments. By default, WordPress puts the following at the end of every comment: </li><!-- #comment-## --> ...
0
votes
0answers
53 views

Image URL only for custom navigation walker (walker_nav_menu)

I'm attempting to build a custom navigation walker that pulls a page's Featured Image into the page's menu item. I intend to use the Featured Image as a background for the menu item (which is prettier ...
0
votes
0answers
46 views

Transform <ul> menu in <table> menu

Someone can help me? I'm trying to create a walker's menu but I think is impossible. I want to create a top level menu as a table, but with 2 rows. For example, a typical one option menu will be: ...
0
votes
1answer
40 views

wp_list_pages hierarchical help

So I have been searching online for something that I think is simple to achieve and I am most likely over thinking it. I have found many related articles on the matter but can't seem to get it to ...
0
votes
1answer
18 views

Need direction on a seemingly complex menu walker for automatically inserting a parent link li in it's submenu ul

I'd appreciate some direction on how to accomplish something with my WordPress menu. I've Googled this for hours without avail. I was to automatically insert a parent link into it's immediate submenu ...
0
votes
0answers
42 views

How to display menu description, but only if there is a sub menu?

Today I've written my own custom menu walker. While I am a bit shocked how difficult this is (also because there seem to be some bugs in Wordpress), I am astonished that I could make everything work. ...
0
votes
0answers
62 views

sub menu in bootstrap is not displaying

this is my custom walker function. class Bootstrap_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth = 0, $args = array()) { $output .= "\n<ul ...
1
vote
2answers
364 views

How to remove trailing </li> tags from wp_nav_menu walker

I have used theme twenty thirteen a my base theme and Have tried used code from http://stackoverflow.com/questions/12159486/wordpress-change-header-navigation-list-items-to-div when I try to validate ...
0
votes
1answer
45 views

Using Different nav_menu_css_class for different nav_walkers

On my theme I have to different nav_walkers, I'd like to be able to call two different nav_menu_css_class-es for each menu alas, they appear to apply globally. Here's what I have function ...
1
vote
0answers
78 views

Walker Class - Check if menu item has description and if so add class to li

I am using a pretty common walker class to pull in the description when I call the wp_nav_menu function. I am using this to add an optional second line for the menu, using the description. This of ...
2
votes
1answer
595 views

Show top-level parent with submenu menu walker

I've used the menu walker below to display dynamic submenus with great effect in the past. It displays 2nd- or lower-level menu items IF the current page is a parent, sibling, or descendant of the ...
0
votes
0answers
85 views

Extending Walker class for Bootstrap 2.3.2

I would like to extend the walker class so that I can show a menu in this format: <div class="accordion" id="accordion2"> <div class="accordion-group"> <div ...
1
vote
1answer
841 views

Customizing Walker_Nav_Menu

I'm looking for a solution to adjust the output of wp_nav_menu only on a specific navigation menu. I have my menu: wp_nav_menu( array( "container" => "nav", ...
0
votes
0answers
35 views

Add static value between second & third menu value

How can I add a static value between second and third menu value? For example, like this: Menu value 1, Menu value 2, STATIC VALUE HERE, Menu value 3, Menu value 4 I know about the Walker_Nav_Menu ...
0
votes
0answers
67 views

How to link to page AND anchor with Menus and/or wp_nav_menu()

Basically I am trying to create a menu that can link to a page and an anchor on that page in one go. I currently have a menu using wp_nav_menu() but I can't see any argument that could directly modify ...
0
votes
1answer
618 views

Adding ul class with wp_list_categories Custom Walker

I am trying to achieve something that seems like it should be simple but is causing me headaches. I am listing my categories out using wp_list_categories which gives me this... <ul> ...
0
votes
0answers
37 views

Creating a custom menu with icon fonts

I want to create a custom menu with icon font markup. So I may need to have my list item have e.g. this: <i class="gen-enclosed foundicon-left-arrow"></i> contained inside anchor - or ...
0
votes
0answers
78 views

Customizing template menu output to fit zurb foundation markup

I want to have custom main menu markup in my Wordpress template. I want it to fit Zurb Foundation markup - to be specific - for submenus. I've figured out how to customize class & id if list ...
0
votes
0answers
200 views

Custom menu walker: how can i check first item

I need to output different html code only for the first item of my submenus. How can I check in start_el() function if current item is first or not? Example: Menu voice 1 -- Sub 1 -- Sub 2 -- Sub 3 ...
0
votes
2answers
553 views

Show children (sub-navigation) of active menu item only

So I've searched the net and attempted to code a custom walker class that will do this, but I'm new to WordPress and although similar questions exist none fit exactly what I'm looking for, or suggest ...
3
votes
2answers
105 views

How does a minimal menu walker look like?

According to the docs of wp_nav_menu we can specify our own walker function. They suggest to copy the default one and modify it as needed. But to be honest, it is a bit too complicated for the to ...
0
votes
0answers
81 views

Additional class for.sub-menu UL?

This code returns my WordPress menu: <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'header-menu') ); ?> What's the easiest (non-JS) way of adding additional ...
2
votes
2answers
940 views

Strict Standards Error bootstrap navwalker

I am having trouble understanding this error and I've not come across it before, please could someone help? Strict Standards: Declaration of wp_bootstrap_navwalker::start_lvl() should be compatible ...