Return to Snippet

Revision: 39758
at January 20, 2011 14:32 by alexchen


Initial Code
<?php $posts = new WP_Query(array(
   'post_type' => 'here_goes_my_post_type',
   'category' => 'Here Goes My Category',
)); ?>
<?php while ( $posts->have_posts() ) : $posts->the_post(); ?>
  <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>
  </div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>

Initial URL


Initial Description


Initial Title
Retrieve custom post types with a category

Initial Tags
wordpress

Initial Language
PHP