Related posts by taxonomies does not work , what could be the reason?

Your tax_query is using an invalid field type. Try: $args = array( ‘post_type’ => ‘films’, ‘post__not_in’ => array($post->ID), ‘showposts’=> 3, ‘tax_query’ => array( array( ‘taxonomy’ => ‘actors’, ‘field’ => ‘term_id’, ‘terms’ => $tax_IDs ) ) ); See the Taxonomy Parameters of WP_Query for more options if that doesn’t wok.

Only return taxonomies that are linked to a category & product

This will find all terms in custom taxonomy underkategorier and then will show terms with post from chosen category. $taxonomies = get_taxonomies(array(‘name’=>’underkategorier’),’object’); foreach($taxonomies as $taxonomy) { $terms = get_terms( $taxonomy->name, ‘orderby=count&hide_empty=0’ ); foreach($terms as $term) { $wpq = array (‘taxonomy’=>’underkategorier’,’term’=>$term->slug, “cat”=>10); $myquery = new WP_Query ($wpq); $article_count = $myquery->post_count; echo $term->name.’ ‘.$article_count; //with empty ones … Read more

How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug

First, you don’t need to have two actions called during init, they can both be done under the same action function — so move the register CPT and taxonomy to a single function (or call separate functions from the main one) — no need to have two init actions. You should also be registering the … Read more