Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 ); 
share|improve this question
    
Update: if I remove post from the types... the rest load, but I still need both. –  matt ryan Jun 2 '11 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 '11 at 14:31
add comment

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.

share|improve this answer
    
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 '11 at 14:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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