I did as it is written in the topic:
insert into the template this code:
/**
* Class MNA_Pad_Counts_Walker adds accurate, padded attachment counts to taxonomy terms.
*
* Class Walker is defined in /wp-includes/class-wp-walker.php
* Class Walker_Category is defined in /wp-includes/category-template.php
*/
class MNA_Pad_Counts_Walker extends Walker_Category {
/**
* MLA Terms
*
* @var array
*/
public $mla_terms = array();
/**
* Constructor - set the MLA Terms.
*
* @param string Taxonomy name/slug.
*/
function __construct( $taxonomy ) {
$attr = array (
'taxonomy' => $taxonomy,
'pad_counts' => 'true',
);
$terms = MLAShortcodes::mla_get_terms( $attr );
unset( $terms['found_rows'] );
foreach ( $terms as $term ) {
$this->mla_terms[ $term->term_taxonomy_id ] = $term->count;
}
}
/**
* Start the element output.
*
* @see Walker::start_el()
*
* @param string Passed by reference. Used to append additional content.
* @param object Taxonomy data object.
* @param int Depth of category in reference to parents. Default 0.
* @param array An array of arguments. @see wp_list_categories()
* @param int ID of the current category.
*/
function start_el( &$output, $taxonomy_object, $depth = 0, $args = array(), $id = 0 ) {
if ( isset( $this->mla_terms[ $taxonomy_object->term_taxonomy_id ] ) ) {
$taxonomy_object->count = $this->mla_terms[ $taxonomy_object->term_taxonomy_id ];
}
parent::start_el( $output, $taxonomy_object, $depth, $args, $id );
}
}// Class MNA_Pad_Counts_Walker
insert in /wp-includes/category-template.php this code:
foreach ($taxonomies as $taxonomy) {
unset( $checklist_walker );
$checklist_walker = new MNA_Pad_Counts_Walker( $taxonomy );
$args = array(
'taxonomy' => $taxonomy,
'hierarchical' => 1,
'hide_empty' => 0,
'pad_counts' => 1,
'show_count' => 1,
'title_li' => '',
'walker' => $checklist_walker,
);
echo '<li id="c' . $taxonomy . '" class="tax_list">' . get_taxonomy( $taxonomy )->label . '<ul>';
wp_list_categories( $args );
echo '</ul></li>';
}
after this code:
function wp_list_categories( $args = '' ) {
$defaults = array(
'show_option_all' => '', 'show_option_none' => __('No categories'),
'orderby' => 'name', 'order' => 'ASC',
'style' => 'list',
'show_count' => 0, 'hide_empty' => 1,
'use_desc_for_title' => 1, 'child_of' => 0,
'feed' => '', 'feed_type' => '',
'feed_image' => '', 'exclude' => '',
'exclude_tree' => '', 'current_category' => 0,
'hierarchical' => true, 'title_li' => __( 'Categories' ),
'echo' => 1, 'depth' => 0,
'taxonomy' => 'category'
);
But there is no result.
What did i do wrong?