WordPress Custom Type loop

With the upcoming version of WordPress 3 (available in beta as of today) here is a tip of how to pull the custom types in the loop once you have created them.

[php]

Recent News

    < ?php $recentPosts = new WP_Query(); $recentPosts->query($query_string . ‘&post_type=news’);
    ?>
    < ?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>

  • Posted on Categories WordPress