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

-1
votes
1answer
182 views

Custom navigation / menu output (walker?)

I'm trying to implement a responsive jQuery navigation but I need to extend the default output of the WP menu. I believe I need to use a custom walker but honestly, I don't know how to get it to work ...
0
votes
1answer
760 views

Single.php Active Category Class

Currently by default (I believe) when you're on single.php, Wordpress doesn't add a "Active" class to the blog category you're viewing the single post in like it would for pages or if you're on the ...
0
votes
0answers
44 views

How can I modify wp_nav_menu with walker?

I would like my wp_nav_menu to output in the format for jquery ui: <h3>Section 1</h3> <div> <p> Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut ...
0
votes
0answers
24 views

Help with Wordpress Walker Function [duplicate]

I need some help customizing a walker function. I don't fully undrestand it, but it's helped me get half of what I need. class themeslug_walker_nav_menu extends Walker_Nav_Menu { // add ...
0
votes
1answer
1k views

Customizing a walker menu class

Hey Folks I trying to customize a walker class to add custom classes to navigation level. Essentially there will be 3 levels of navigation. <ul *custom class*> <li *custom class*> ...
0
votes
1answer
55 views

Modifying navigation menu classes with a Walker

I did a class that extends Walker_Nav_Menu to modify the default classes of my < li >s but also to modify the default classes of my < ul >s. It seems that only the sub-menus are affected by the ...
0
votes
1answer
122 views

Walker for menus

I want to modify all of my <li>'s classes and ids, but the function wp_nav_menu() does not let me do so, so I think I need to use a walker. I am pretty new in OO, so using an object is not ...
0
votes
1answer
97 views

custom walker class for own menu?

i have designed a html template for own blog, in my theme my menu is this structure, <ul class="right"> <li class="has-dropdown"> <a class="active" href="index.html">Home</a> ...
1
vote
0answers
95 views

Customizing Primary Menu to include custom taxonomy description

I've a hard time implementing the custom primary menu behaviour. I've already: Created a custom post type: products that has a custom taxonomy: product_category associated with it. Activated and ...
0
votes
1answer
851 views

Use wp_nav_menu to dynamically generate child menus

The goal: use wordpress's wp_nav_menu to generate a menu where child pages were dynamically added while keeping the correct submenu classes. Before: Installations Habits After: Installations ...
0
votes
1answer
119 views

How do I separate link levels in a custom menu walker?

I am trying to build a custom menu walker and I am unclear on how I would be able to build a UL for top level menu items and a separate UL for all menu items of lower levels. Essentially I am trying ...
0
votes
0answers
103 views

Split submenu displaying the description underneath

By using the below class, I was able to extend the Walker_Nav_Menu and display the description under the link. I'm working with an UI that requires to have submenu split that also display the ...
0
votes
2answers
130 views

Adding a tag to wp_nav_menu

I am using wp_nav_menu and I have a need for custom implementation. The default markup is like this: <ul> <li id="menu-item-59" class="menu-item menu-item-type-post_type ...
2
votes
1answer
2k views

Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu

I am trying to add some ARIA related stuff to the wp_nav_menu function. I use a custom walker class for this purpose: class Walker_Nav_Menu_With_Aria extends Walker_Nav_Menu { function ...
0
votes
1answer
68 views

changing the labels inside appearance -> menus for some for the fields

So I've create a custom walker for nav menu (i am talking about the menus located at: appearance -> menu -> add a new menu. I now use the following for several things i need: URL Title Attribute CSS ...
1
vote
1answer
342 views

ol children instead of ul children

I've created a new walker class to display a custom layout when using the wp_list_comments(); function and this is perfect, the only thing is that all replies to one comment are listed in a <ul> ...
0
votes
1answer
2k views

Add <span> within the <li> output of <? wp_nav_menu() ?>

Im currently printing out: <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> Which outputs: <div class="menu"> <ul> <li ...
0
votes
2answers
76 views

alternating classes on wp_list_pages

I'm trying to have alternating classes on the list created by wp_list_pages. Currently I have extended the Walker_page class updating the start_el function as follows: class Sidebar_walker extends ...
1
vote
1answer
58 views

Limit Custom Crawler to front end only

I am using the following custom walker to hide the Login and Register pages from my navmenu created with wp_get_nav_menu_items..... function wpse31748_exclude_menu_items( $items, $menu, $args ) { // ...
1
vote
1answer
3k views

Show thumbnail for category?

I currently have a code where, in my category.php, it checks if the specific category has subcategories, and if it does, show them using wp_list_categories. I'd love to have these wp_list_categories ...
1
vote
0answers
303 views

Walker_Nav_Menu doesn't work in wp_page_menu_args filter

I need to hide certain nav items from the menu (based on the password protection functionality) and I'm having trouble getting my custom Walker to work. In fact, I can't even get the standard ...
0
votes
1answer
93 views

wp_nav_menu - Collapse with PHP

How can wp_nav_menu be used to collapse and expand elements with PHP? Some walker function? Plugin maybe? What it looks like in wp-admin menus About Customers Cases Contact Contact us ...
0
votes
1answer
820 views

How to get current pages menu text?

Is there an easy way of outputting the current pages menu text? I am looking for something like <?php echo get_the_title(); ?> But for the current pages menu text.
2
votes
1answer
452 views

Adding 'active' class to custom taxonomies using walker in functions.php

I'm trying to use the following code in functions.php in order to show a menu with categories (custom taxonomies actually). I simply want it to show active when on the current page. What am I doing ...
0
votes
1answer
650 views

Costum walker with sub menu item count

I have a menu like: -Item1 --Sub1 --Sub2 --Sub3 --Sub4 --Sub5 --Sub6 -Item2 -Item3 and want to do some costum stuff after x subitems, so I have to determine when x is reached. I tried to define a ...
0
votes
2answers
509 views

How to exclude/remove submenu using Walker_Nav_Menu

i'm working on the new site with custom menu and extended Walker_Nav_Menu class to add custom content to the wp nav menu. i have registered a custom select box (key: my_custom_menu) in menu from ...
0
votes
1answer
250 views

Does the 'nav_menu_css_class' filter accept 2 or 3 arguments?

I've been using the nav_menu_css_class filter in one of my plugins, implemented as: add_filter( 'nav_menu_css_class', 'wbwcrf_nav_menu_css_class', 10, 3 ); function wbwcrf_nav_menu_css_class( ...
0
votes
2answers
1k views

Custom Nav Walker menu - Display children count

I have a custom walker menu.( See the code below) I would like to have my nav menu like this ---------------------------------- Home | link1 | link2 | link3 (5) ---------------------------------- ...
2
votes
1answer
530 views

Custom Nav Walker to show siblings and children of current branch?

I have seen very similar (if not exact) queries to this all over Google, but always seem to find something short of what I need. I am trying to create my full vertical menu using wp_nav_menu in my ...
10
votes
3answers
4k views

Custom Nav walker display current menu item children, or siblings on no children

I've been messing around / searching for hours and still can't get this to work, so i'm finally giving in and asking for some help. I'm trying to write a custom walker that shows only the current ...
0
votes
1answer
411 views

Check is category parent with ids from the childs - get_term_children

I have a hierarchical category list, like: A (Parent Category) - B (Child Category) - C (Child Category) - D (Child Category) B (Parent Category) - E (Child Category) - F (Child Category) ...
0
votes
1answer
52 views

Custom Links in Walker Class

I am creating a custom walker class. I need to identify the custom links that will be added to the menu from Appearace > Menu > Custom Link so that they will have a different format to the page/post ...
-1
votes
1answer
631 views

get_category_children/ the new get_term_children not work

I have a custom Walker for a Advanced Search, that outputs the categories for multiple search by categories in checkbox. The Problem here is, that i use the get_category_children for the children ...
0
votes
1answer
4k views

Adding attributes to <a> link in wp_nav_menu using custom Walker function

I am trying to generate a menu using wp_nav_menu. My expected output is this: <!-- Main Menu --> <div class="navbar navbar-blue navbar-fixed-top" style="margin-top:74px"> ...
3
votes
1answer
2k views

Determine if a navigation item has children

I am trying to determine if an item has a sub-item with depth 1 or higher. I cannot find anywhere if there is some function/query I can write that grabs the current item looks in the database if it ...
2
votes
1answer
716 views

Adding dynamic content to end_lvl in Walker Class

I'm trying to add unique content to the end of each dropdown (sub-menu). I've managed to edit the end_lvl function of the walker class to add the div to the end of each sub-menu, but now I'm lost on ...
0
votes
1answer
494 views

custom walker to add iconfont to wp_nav_menu

I want to add the font awesome iconfont to my menu list items, so I need to make a custom Walker. Because the font per menu item will be different I was hoping to use the css class in the WP backend ...
1
vote
1answer
569 views

Customize comment list markup

While creating a new theme, we'll have to customize the comment flow. For doing so there are two functions: wp_list_comments() and get_comments(). I am not very sure how to style the inner elements ...
0
votes
1answer
300 views

Walker_Nav_Menu creating too many closing tags?

created this walker below to create a set of tabs. All looks ok but in the source there are several more than there should be causing validation errors. I only want to generate a tab for 'question' ...
0
votes
2answers
97 views

How to prevent custom walker from creating sub navigation for pages that are not relatives of the current page?

I have a custom walker that extends the Walker class. My code uses the Walker_Page class as it's base as it does pretty much everything else I want but I need to modify it a bit so that it behaves a ...
5
votes
2answers
418 views

Call custom field into menu item

I have a navigation menu in Wordpress. I would like it to check if the page has a custom field of "menu_icon" and if it does, add that custom field into the menu item it corresponds to. I'm sure this ...
5
votes
3answers
2k views

start_lvl ignored in custom walker_nav_menu

This is my first project involving wordpress and i've got stuck trying to create a custom walker for a footer menu. I basically want to change the menu from the <ul> <li></li> ...
0
votes
2answers
5k views

add span class inside wp_nav_menu link anchor tag

I found examples adding a class to top level items, so we can display an arrow in menu items with sub-items, but is seems terrible to cope with the already built in WordPress classes, can't display ...
2
votes
1answer
655 views

Walker gives additional taxonomy name?

I'm a beginner at Wordpress, so I would appreciate it if any of you could nudge me in the right way. Anyway, what irks me is how wp_list_categories (and similar functions) produce a lot of unnecessary ...
3
votes
1answer
475 views

Extend walker class with custom post types [closed]

I'm using the walker class below, but I can't make it work with custom posts. class Zwp_Walker_Nav_Menu_Dynamic extends Walker_Nav_Menu { function end_el(&$output, $item, $depth) { ...
1
vote
1answer
143 views

custom walker wp menu last element

I have a menu list with many subitems that contain submenus as well (at the moment some reach 4th level). How can I put on each last descended ul of each li element a class ".last"? for example I ...
-1
votes
1answer
87 views

Navigation won’t update to show full path to single post

I have a site with a custom post type “projects” and two taxonomies “clients” and “mediums”. For the navigation I’m using a custom nav walker (that extends Walker_Nav_Menu). This all works very well ...
0
votes
1answer
226 views

wp_nav_menu check both hierarchy fail?

I see that in menu exist to kind of hierarchy to find the parent and ancestor. They look for "category or page" hierarchy or for "menu item" hierarchy. But when both exist in a depth tree branch, ...
5
votes
2answers
331 views

Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?

Essentially I'm trying to add multiple sub nav menus and I'm pretty close but I just can't seem to find the right tack to solve my problem ... I'm using a variation of a Stu Nichols CSS Menu ... ...
1
vote
0answers
411 views

wp_nav_menu custom walker - child items

I have written a custom walker to integrate a jquery dropdown nav script into my wp template. I need to add .dropdown-link to each of my parent menu items and .dropdown-wrapper to the unordered list ...