Skip to content

Instantly share code, notes, and snippets.

@LeahArmstrong
Last active August 29, 2015 14:00
Show Gist options
  • Save LeahArmstrong/11270483 to your computer and use it in GitHub Desktop.
Save LeahArmstrong/11270483 to your computer and use it in GitHub Desktop.
Wordpress Loop Query for filtering posts by format-type
$args = array (
'pagination' => false,
'posts_per_page' => '3',
'ignore_sticky_posts' => true,
'post_type' => 'post',
'tax_query' => array(
array(
// Specifies post-format taxonomy type
'taxonomy' => 'post_format',
'field' => 'slug',
// Defines term/s to query using 'post-format-*'
'terms' => 'post-format-video',
// The operator allows you to exclude posts of that format type
'operator' => 'NOT IN'
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment