I have 3 different custom post types: 1.) "events", 2.) "winners" and 3.) "offers". How would I go about retrieving the first (latest) post in each of these post types on a single web page (i.e a home page).

Would I use get_posts() or would I have to manipulate the_loop()?

2 Answers
2

Yes, get_posts is the safest way to use multiple loops. It does not mess up with the original query.

Another way would be to create new WP_Query objects:

$my_query = new WP_Query($args);
while ($my_query->have_posts()) : $my_query->the_post();

Note: Why you should not use query_posts()

Leave a Reply

Your email address will not be published. Required fields are marked *