I feel like I've been banging my head against the keyboard for a week with this problem. I'm trying to change my current query on my home page to show only posts that are set as standard posts using the new post format.
I've looked everywhere for answers (including here and here) and tried everything I've found, but I can't get it to work within the framework of my current query.
My query is provided below. Any help is greatly appreciated.
<?php
query_posts( array( 'post__not_in' => $ids, 'showposts' => 10, 'cat' => '-4' ) ); ?>
<?php while (have_posts()) : the_post(); ?>
-LOOP STUFF-
<?php the_excerpt(); ?><BR>
<?php endwhile; ?>
UPDATE - March 30: Since I posted this I found out how to properly query for, we'll say, image posts using this code:
<?php
$args = array(
'post__not_in' => $ids,
'showposts' => 10,
'cat' => '-4,-1866,-27',
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => 'post-format-image'
)
)
);
query_posts( $args ); ?>
<!-- Look Stuff -->
<?php endwhile; ?>
But I still need to figure out how to do the opposite and only pull standard posts.
Second Update - March 30: I found the answer after some more hunting. Apparently the only way to pull the standard posts is to add:
'operator' => 'NOT IN',
So it looks for posts that aren't in the image post format. Or I have to add an array of terms to the terms line so it won't return any of those formats. Odd, but it works.
'tax_query' => array( array( 'taxonomy' => 'post-format', 'field' => 'slug', 'terms' => array( 'post-format-quote' ) ) )
to get only your wanted post type'taxonomy' => 'post_format'
. Underscore not hyphen. This is for Bainternet's comment , it looks right in your code.