WordPress.org

Support

Support » Plugins and Hacks » Custom Post Type templates won't show just 1 post?

Custom Post Type templates won't show just 1 post?

Viewing 1 replies (of 1 total)
  • Here’s the code I’m using to display this:

    <?php query_posts( 'post_type=case-studies','showposts=1'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <h1 class="page-title" itemprop="headline"><?php the_title(); ?></h1>
    
    <div id="content">
    	<dl>
    		<dt>Situation:</dt>
    		<dd><?php the_field('situation'); ?></dd>
    	</dl>
    
    	<dl>
    		<dt>Challenge:</dt>
    		<dd><?php the_field('challenge'); ?></dd>
    	</dl>
    
    	<dl>
    		<dt>Approach:</dt>
    		<dd><?php the_field('approach'); ?></dd>
    	</dl>
    
    	<dl>
    		<dt>Result:</dt>
    		<dd><?php the_field('result'); ?></dd>
    	</dl>
    
    </div> <!-- end #content -->
    <?php endwhile; ?>
    
    <?php endif; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Post Type templates won't show just 1 post?’ is closed to new replies.