Any walker causes blank menu?

You need to make sure your menu is properly registered in your functions.php and then activated in the WP Dashboard. add_action( ‘init’, register_nav_menu( ‘navigation’, __( ‘Navigation’ ) ) ); Otherwise I was just facing a long list of empty bullet points. http://codex.wordpress.org/Navigation_Menus

Custom Nav Walker menu – Display category count

I think you should probably use wp_list_categories(), which even has parameters for a count, like e.g. show_count and pad_counts. Additionally it supports custom walkers via the walker parameter, but the walker would be based on Walker_Category – source -, which gives you every additional styling option you want.

Why is my menu order not working with wp_nav_menu?

AFAIK there’s a non-documented orderby parameter, that can be set to menu_order. Edit: Straight from core, inside /wp-includes/nav-menu-template.php Line# 195 (WP 3.3.1): $sorted_menu_items = array(); foreach ( (array) $menu_items as $key => $menu_item ) $sorted_menu_items[$menu_item->menu_order] = $menu_item; It’s the lines immediately before the Walker runs. So the set menu_order should affect the order. You’ll just … Read more

List Hierarchical Term List with Count with Related Term

I’ve done something like this in the Query Multiple Taxonomies plugin: https://github.com/scribu/wp-query-multiple-taxonomies/blob/master/core.php The good news is that it’s a generic solution: it works for any combination of posts and taxonomies. The bad news is that it might take some effort to figure out how it’s done.

Determine if a navigation item has children

You can filter wp_nav_menu_objects and add the classes in one rush. You don’t even need a custom walker for that. add_filter( ‘wp_nav_menu_objects’, ‘add_has_children_to_nav_items’ ); function add_has_children_to_nav_items( $items ) { $parents = wp_list_pluck( $items, ‘menu_item_parent’); foreach ( $items as $item ) in_array( $item->ID, $parents ) && $item->classes[] = ‘has-children’; return $items; } The class has-children will … Read more

add span class inside wp_nav_menu link anchor tag

Have you tried using the before or link_before parameters in your array arguments when declaring your wp_nav_menu function? Note: use after or link_after for the opposite effect. Example, wp_nav_menu( //normal arguments here….etc ‘before’ => ‘<span class=”arrow”></span>’, //or ‘link_before’ => ‘<span class=”arrow”></span>’, ); From the Codex: $before (string) (optional) Output text before the of the link … Read more

Call custom field into menu item

This is what i have used for checking to see if the custom field is there or not. I am sure you can use it as well. <?php $custom_field = get_post_meta($post->ID, ‘Your Custom Field Name’, true); // Checks to see if there is a value in the custom field if($custom_field != ”) { echo $custom_field; … Read more

WordPress 4.4+ breaks Walker Extension

Your original solution was a hack, and no surprise it failed. In general never add methods/attributes to objects that you do not control their class and future development. The right way is to create your own object to be passed to the walker. Pass to it the category object on construction and either populate fields … Read more

How to create this custom menu walker?

You need to set-up your own menu walker (link to WordPress Codex), and in there add custom start_el and end_el overrides. So for example your start_el and end_el may look something like this: function start_el(&$output, $item, $depth=0, $args=array()) { $output .= “<div>” . esc_attr($item->label); } function end_el(&$output, $item, $depth=0, $args=array()) { $output .= “</div>\n”; } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)