How to Recent Post Show Exclude a Specific Taxonomy?

How to Recent Post Show Exclude a Specific Taxonomy? Recent post show without a specific category. Recent post show without a specific Taxonomy. Recent post show without a specific category. Recent post show without a specific category in WordPress. WordPress recent post show exclude a specific category. Recent post show exclude a specific category for WordPress. If you say name but solution is very easy. Just follow our instructions step by step. Recent post show exclude a specific category without plugin in WordPress.

<div id="content" class="content">
<?php
$args = array( 
'tax_query' => array (
 array(
 'taxonomy' => 'category', // Put your post Taxonomy
 'terms' => 'job', // put your Taxonomy Term name that you wanted to exclude from recent post
 'field' => 'slug', // here passing term Slug or term ID
 'operator' => 'NOT IN', // this is Selection operator - use IN for include,& NOT IN for exclude post
 ),
 ),
 'post_type'=>'post', // set Post typethat you want to show, you can show also custom post type
 'order'=>'DESC',
 ); 
 $query = new WP_Query( $args ); ?> 
<?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
<div class="post-view articles"> 
<div id="post-<?php the_ID(); ?>" <?php post_class('post') ?>>
 <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
 //write your code here for what you show
</div>
</div>
<?php endwhile; endif; ?>
</div>

​Leave a Comment

Comment authors age:




How to import too large database file in phpmyadmin?

How to add next and previous post in WordPress?