How to display latest post from custom Post type by custom taxonomy category ?
To display latest post from custom Post type by custom taxonomy category you have to write the below code where you want to display the post. If you have doubt while doing this please comment it below.
<?php $args = array( 'post_type' => 'news', // Change to your custom post type slug // 'posts_per_page' => 1, // Change to your post count to dispaly // 'tax_query' => array( array( 'taxonomy' => 'news_category', // Change to your post type taxonomy // 'field' => 'slug', 'terms' => 'media' // Change to your post category // ) ) ); $products = new WP_Query( $args ); if( $products->have_posts() ) { while( $products->have_posts() ) { $products->the_post(); ?> <div class="news"> <div class="col-sm-4 news_img"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail( 'medium', array( 'class' => 'alignleft' ) ); ?> </a></div> <div class="col-sm-8"> <h4><a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a></h4> <?php the_time('F jS, Y') ?> <?php //Show Post Content the_content(); ?> </div> </div> <?php } } ?>