• Hi, I wanted to limit the display of my custom post types to 5, any ideas how to accomplish this?

    please look at my current code below

    <?php
    
    get_header(); // This fxn gets the header.php file and renders it 
    
    query_posts( 'post_type=pattern' );
    
    ?>
    	<div id="two-column" class="row">
    			<div class="span3">
    				<h4>Come Visit Stencil Land!</h4>
    				<p>Come meet us at our brand new Stencil Land retail location. <strong>7503 Madison St. in Forest Park!</strong> We're the perfect place to come to craft with your kids for some quality time or have a party. We do birthdays, showers, Christenings, bachelorettes—you name it. <a href="">(Learn More)</a></p>
    				<hr width="70%">
    				<h4>GALLERY</h4>
    				<p><a href="gallery.html"><img src="<?php echo get_bloginfo('template_directory'); ?>/img/gallery4.png" width="220" height="220"></a></p>
    				<hr width="70%">
    				<h4>HOW TO</h4>
    				<p><a href="howto.html"><img src="<?php echo get_bloginfo('template_directory'); ?>/img/how.jpg" width="220" height="85" border="0"></a></p>
    				<hr width="70%">
    				<h4>TWEET</h4>
    				<hr width="70%">
    			</div>
    			<div class="span7">
    				<div class="row products">
    					<h1><img src="<?php echo get_bloginfo('template_directory'); ?>/img/hot-patterns.png" alt="hot patterns" /></h1>
    					<p class="category">
    						<a href="shop.html">VIEW ALL</a>
    						<a href="">NATURE</a>
    						<a href="">SYMBOLS</a>
    						<a href="">KIDS</a>
    						<a href="">HOLIDAY</a>
    						<a href="">THOUGHTS</a>
    					</p>
    
                        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    					<div class="span4">
                            <?php
                                $field = get_field_object('label-category-color');
                                $value = get_field('label-category-color');
                                $label = $field['choices'][ $value ];
                            ?>
    						<div class="span1 boxText" style="background-color: <?php the_field('label-category-color'); ?>;"><?php echo $label; ?></div>
                                <div class="productTitle">
                                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                </div>
    						<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
    					</div>
    
                        <?php endwhile; endif; ?>
    				</div><!-- /products -->
    
                    <?php get_template_part('tools'); ?>
    
                    <!-- /tools -->
    			</div>
    		</div><!-- /two-column -->
    		<div id="chief-column" class="row">
    			<div class="span4">
    				<img src="<?php echo get_bloginfo('template_directory'); ?>/img/lindacso.png" alt="xxx xxx" width="250" height="324">
    			</div>
    			<div class="span7">
    				<p>"Let's make something beautiful!"</p>
    				<p><em>xxx xxx</em></p>
    				<p>Chief Stenciling Officer</p>
    			</div>
    		</div><!-- /chief-column -->
    <?php get_footer(); ?>
  • The topic ‘custom post types limit display’ is closed to new replies.