WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Can't display only one custom post type post on a custom post type template (2 posts)

  1. morgon
    Member
    Posted 1 year ago #

    I've installed this plugin: http://wordpress.org/extend/plugins/custom-post-template/, and enabled it for custom post types. However, I can't seem to limit the post template I've made to only show the 1 post in a single post template kind of way.

    What I'm doing is using the custom post types UI plugin (http://wordpress.org/extend/plugins/custom-post-type-ui/) to create the post types for "Case Studies" on my client's site. There is a "case studies" page template which shows a list of the case studies, and I need to show each case study on their own single page.

    I'm wondering if there is some unique way that the Custom Post Type UI plugin creates custom post types that would be hindering this?

    Here's the code I'm using to display on the post template:

    <?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; ?>

    Any help?

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 1 year ago #

    Ever get around this issue morgon?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic