views:

13

answers:

1

Is there a way to query multiple specific posts? For example, the following gets one:

        // retrieve one post with an ID of 670
        query_posts('p=670');   

But as far as I can tell, I can't extend this to do two posts, separated by commas. Does anyone know a better way?

+1  A: 

This should work:

query_posts(array('post__in' => array(670, 671, 672)));

Source: http://codex.wordpress.org/Function_Reference/query_posts#Post_.26_Page_Parameters

Daniel15
Brilliant! Thank you. I will approve once time limit is up.
Matrym