This query works in some places, but not in others... right now it's not working on the home page. This query is in a file that is included into index.php of my theme.

The regular posts show, but no cutom post types. What's wrong with this query?

$args = array(
  'post_type' => array('post', 'video', 'slideshow', 'poll', 'quote'),
  'orderby' => 'date', 
  'order' => 'DESC'
); query_posts( $args ); 
  • Update: if I remove post from the types... the rest load, but I still need both.
    – Matt Ryan
    Jun 2, 2011 at 14:19
  • My own stupidity is to blame... the query was fine, it was the posts per page limit that stopped me from seeing the 'missing posts'. Apologies!
    – Matt Ryan
    Jun 2, 2011 at 14:31

1 Answer 1


Check that index.php is indeed being used, it's last resort kind of template when there is no more suitable one.

If you need this in multiple places across the site it might be better to run this in some hook, rather than in template file.

  • It is the index that is being used. Even if I use a hook instead, wouldn't the query be the same? Strangely, if I reduce the post_type array to a single class of custom post types that type will display.
    – Matt Ryan
    Jun 2, 2011 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.