WordPress.org

Support

Support » Themes and Templates » Display set amount of custom posts

Display set amount of custom posts

  • Hi I am using custom post types and I wish to have show_posts=5 but I am not sure where to put the code. my knowledge of php is very basic. Thanks

    <?php query_posts( 'post_type=latestnews'); ?>
    	            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    	                     <?php $currentid = get_the_id(); ?>
    	                                	<ul class="line">
    	                                		<li><a href="<?php the_permalink(); ?>"><?php echo get_the_title($currentid); ?></a></li>
    	                                	</ul>
    
    	                    <?php
    	                endwhile;
    	            endif;
    
                wp_reset_query();
                ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display set amount of custom posts’ is closed to new replies.
Skip to toolbar