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 );
Here is the page template https://pastebin.com/kf5v7NQf
Here is the loop https://pastebin.com/rYk8JdJT
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Exclude post formats from custom loop’ is closed to new replies.