Get taxonomy url, name, post count & image

Don´t know how this plugin works in detail but i would try this: <?php $taxonomy = ‘channel’; $tax_terms = get_terms($taxonomy); ?> <ul> <?php foreach ($tax_terms as $tax_term) { ?> <li> <?php echo esc_attr(get_term_link($tax_term, $taxonomy)); ?> <?php echo $tax_term->name; ?> <?php echo $tax_term->count; ?> <?php print apply_filters( ‘taxonomy-images-queried-term-image’, ” ); ?> </li> <?php } ?> </ul>

Displaying subcategories and then posts in taxonomy template

Please try this <?php $term = get_queried_object(); $term_id = $term->term_id; $taxonomy_name = $term->taxonomy; $termchildren = get_term_children( $term_id, $taxonomy_name );?> <?php foreach ( $termchildren as $child ) { $term = get_term_by( ‘id’, $child, $taxonomy_name ); ?> <li> <?php echo $term->name; ?> <?php echo $term->description; ?> </li> <?php } if ( have_posts() ) : /* Start the … Read more

how do you get one specific term from a shortcode attribute?

It seems like you are trying to get a term by it’s slug or name. get_term() will get all the term’s data by it’s id. In this case, use get_term_by() instead: function product_category_button($atts) { extract(shortcode_atts(array( ‘category’ => ”, ), $atts)); // if( $category ) : // Vars $taxonomy = ‘product_categories’; // Use ‘name’ instead of … Read more

Change the last separator in the_terms

$terms = get_the_term_list( $post->ID, ‘post_tag’, ‘Tags: ‘, ‘, ‘, ”); echo preg_replace(‘/^(.+),([^,]+)$/’, ‘$1 &$2’, $terms); Explanation for /^(.+),([^,]+)$/: / – delimiter ^ – string beginning .+ – 1 or more characters [^,]+ – 1 or more characters that are not a comma $ – string end $n is the nth match i.e. nth pair of … Read more

Add subcategories posts to the counts column at the admin’s categories list

You can change an array of get_terms() arguments with two filters: get_terms_defaults filters the terms query default arguments; get_terms_args filters the terms query passed arguments. For example, this code will change the default value for the pad_counts parameter for all queries related to categories and called from the administrative part of the site. add_filter( ‘get_terms_defaults’, … Read more