How to query posts of standard post format. For real

It looks like your syntax is a little off for the tax query. Try this:

$query = new WP_Query( array(
        'post_type' => 'post',
        'cat' => '-1',
        'posts_per_page' => 2,
        'tax_query' => array( array(
            'taxonomy' => 'post_format',
            'field' => 'slug',
            'terms' => array('post-format-aside', 'post-format-gallery', 'post-format-link', 'post-format-image', 'post-format-quote', 'post-format-status', 'post-format-audio', 'post-format-chat', 'post-format-video'),
            'operator' => 'NOT IN'
           ) )
       );

(Aside: If you’re not using some of those post formats, it’s fine to remove them from the ‘terms’ array. But if the goal is to only display the ‘normal’ format, you might want to leave them all there in case of future content changes.)

Leave a Comment