php - How to make a page for Custom Post Types in Wordpress 3.0? -
i have custom post types, such 'review'. can't seem find out how make section (e.g., www.mysite.com/reviews/) works blog home page, lists reviews instead of posts (with pagination , everything). i'd use separate template too.
create page called reviews , create new template in theme folder called page-reviews.php. add necessary elements template , include query_posts in front of post loop. should this:
<?php query_posts("post_type=reviews"); ?> <?php if (have_posts()) :?> <?php while (have_posts()) : the_post(); ?> <div class="post" > <h2><a href="<?php the_permalink() ?>" ><?php the_title(); ?></a></h2> <?php the_content(); ?> </div><!-- post ends --> <?php endwhile; ?> <?php else: ?> <p>sorry, not find looking for</p> <?php endif; wp_reset_query(); ?>
Comments
Post a Comment