0

I'm trying to get posts with not marked with any type of post types (aside, audio etc). But I didn't find any solution to do this. I thought doing this with custom fields but site has a lot of posts...

1
  • 1
    If indeed you're asking about post format, please update your post title and question so it's clear for the future. Commented Aug 27, 2014 at 23:27

1 Answer 1

0

I believe that you're asking about post format and not post type. Assuming that's correct, you'll probably be using WP_Query to query all posts of the post format "Standard." However, as noted in this trac ticket, there's strangely no way to query for the standard post format. Instead you need to query for all posts NOT IN any other format.

Alex King put together a fairly involved snippet that does this.

A simpler snippet is found in this Stackoverflow answer to a similar question:

array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-quote','post-format-audio','post-format-gallery','post-format-image','post-format-link','post-format-video', 'post-format-aside'), 'operator' => 'NOT IN' ) 

The above would be the value of the tax_query argument in an instance of WP_Query.

2
  • I added 'post-format-aside' to in my code and it solved my problem thank you @mrwweb. updated title ^^. Commented Aug 28, 2014 at 4:12
  • Good catch. Code updated. Commented Aug 28, 2014 at 15:08

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.