WordPress.org

Support

Support » Plugins and Hacks » Custom Post Type UI » [Resolved] Can't display only one custom post type post on a custom post type template

[Resolved] Can't display only one custom post type post on a custom post type template

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Can't display only one custom post type post on a custom post type template’ is closed to new replies.
Skip to toolbar