return a single post in a loop
-
I am trying to create a single-{post_type}.php template file, I don’t know why my custom post type template is returning all the posts. Not sure where i’m going wrong, can anyone help me out?
<?php $args = array ( 'post_type' => 'foxware_recipe' ); $the_query = new WP_Query ( $args ); ?> <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h3><?php the_title(); ?></h3> <?php the_content(); ?> <hr> <?php endwhile; else: ?> <p>There are no posts or pages</p> <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘return a single post in a loop’ is closed to new replies.