I'm trying to exclude all post formats but standard from a page template loop that displays 4 latest posts. For some reason I can't get the query to work.
This is my page template
global $paged, $wp_query, $wp;
$args = wp_parse_args($wp->matched_query);
if ( !empty ( $args['paged'] ) ) {
$wp_query->set('paged', $args['paged']);
$paged = $args['paged'];
}
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('cat=0&posts_per_page=4&paged='.$paged); //set your own query here
get_template_part( 'loop', 'portfolio' );
wp_reset_query();
This is the loop
<?php $num_cols = 4; // set the number of columns here
for ( $i=1 ; $i <= $num_cols; $i++ ) :
echo '<div class="column col-' . $i . '" >';
$counter = $num_cols + 1 - $i; ?>
<?php while (have_posts()) : the_post();
if( $counter%$num_cols == 0 ) :
// begin of core posts output ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
POST STUFF
<?php //end of posts output
endif; $counter++;
endwhile;
rewind_posts();
echo '</div>'; //closes the column div
endfor; ?>
<?php if ( $wp_query->max_num_pages > 1 || get_query_var('page')) : ?>
<?php twentytwelve_content_nav( 'nav-below' ); ?>
<?php endif;
wp_reset_query(); ?>
This is the query I've been trying to get to work with it
$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 );