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

WordPress Menu Custom Walker Class

The easiest way is to extend the Walker_Nav_Menu class rather than the Walker_Class, (as the parent / ID fields are set and often you want to maintain some of the mark-up etc). The main methods are: start_el / end_el – responsible for displaying an element in a list start_lvl / end_lvl – responsible for displaying … Read more

Assign posts to taxonomy terms instead of the taxonomy terms to posts?

I think the “Featured Post Manager” plugin will be closer to what you’re looking for: http://wordpress.org/extend/plugins/featured-post-manager/screenshots/ The language used is somewhat confusing, and it may not work for custom taxonomies (directories) or custom types (people), BUT you can probably take the code and customize it to work for those classes of things instead, as well … Read more