Post Formats
-
Hello guys, I am trying to query by post format. Here is my code,
$args = array( 'tax_query' => array( array( 'taxonomy' => 'post-format', 'field' => 'slug', 'terms' => array('post-format-video'), ) ) ); $query = new WP_Query($args); if ($query -> have_posts()) : while ($query -> have_posts()) : $query -> the_post(); $out .= get_the_title(); endwhile; endif; return $out;
The query works fine when I do this,
$query = new WP_Query('showposts=5');
It just does not return anything when I try to use the ‘tax_query’ as shown above.
Also, I am using the WooTumblog plugin which is registering the formats with this line, and I can see the post formats in my admin so there should not be a problem there.
add_theme_support( 'post-formats', array( 'aside', 'image', 'audio', 'video', 'quote', 'link' ) );
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Post Formats’ is closed to new replies.