[Resolved] Exclude post formats from custom loop
I need to exclude all post formats but the standard from a page template loop that displays 4 most recent posts. This is the code I’ve been trying to get working, after 3 hours I can make it do just about everything except what I want.
$args = array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-aside', 'post-format-image' ), 'operator' => 'NOT IN' ) ) ); $query = new WP_Query( $args );
- The topic ‘[Resolved] Exclude post formats from custom loop’ is closed to new replies.