Template for custom taxonomy for custom post type broken

From code for post type and custom taxonomy, your CPT is post_features and taxonomy is features. For single post_features, you need to have file named single-post_features.php. For archive, create file taxonomy-features.php. See documentation for detail. https://codex.wordpress.org/Post_Type_Templates Example for single(single-post_features.php): <?php get_header(); ?> <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); the_title(); … Read more

Query only current post type using taxonomy

If you look at WordPress’ available query variables, you will notice post_type. You will need to add that to your URL: $terms = get_the_terms( $post->ID , ‘category’ ); foreach ( $terms as $term ) { $term_link = get_term_link( $term, ‘category’ ); if( is_wp_error( $term_link ) ) continue; $term_link = add_query_arg( array( ‘post_type’ => $post->post_type ), … Read more

How to query Posts from a custom post type which contains a custom taxonomy?

You have one or two issues here and possible future bugs that you might encounter term in your tax_query should be terms Be carefull with terms having dates as names and especially dates as slugs. This can cause issues and unexpected results if custom permalinks clash or if something falls into the template hierarchy for … Read more

How to change single custom post template by custom taxonomy?

What you would do, is have your default single-article.php. This will get called by default because of the WP permalinks and templating system. At the top of your single-article.php do the following before your get_header() call: <?php $language = get_the_terms( get_the_ID(), ‘language’ ); if ( ! is_wp_error( $language) && $language && ‘French’ == $language[0]->name ) … Read more