0

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 ); 
2
  • 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
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.

1
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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