WordPress.org

Support

Support » How-To and Troubleshooting » How to display the latest 5 posts

How to display the latest 5 posts

  • Hi, I am not an expert in PHP, and I have a code which displays only an excerpt of the latest post. I am looking to change this in changing it to display the latest 5 posts. I hope someone can help me with the code. Thanks in advance.

    The original code is the following:

    [please mark any code using the ‘code’ button or backticks as described in the forum guidelines for posting code – the code below is already partially corrupted]

    <div class="clearfloat">
    	<h3 class="cat_title"><?php the_category(', '); ?> »</h3>
    	<h2 class="title"><a>" rel="bookmark"><?php the_title(); ?></a></h2>
        <?php colabs_post_meta(); ?>
        <?php
    		$latest_thumb=get_option('colabs_latest_post_thumb');
    		if($latest_thumb!='No'){
    		$width = get_option ( "colabs_thumbWidth_LatestPost" );
    		$height = get_option ( "colabs_thumbHeight_LatestPost" );
    		if ( $width == 0 ) { $width = 150; }
    		if ( $height == 0 ) { $height = 150; }
            colabs_pp('width='.$width.'&height='.$height.'&size=medium-thumb&play=true&wrapper_class=left&link=img');
    		}
    	?>
    	<?php the_excerpt(__('Read the full story »','colabsthemes')); ?> <a>" rel="bookmark">Read the full story »</a>
    	</div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to display the latest 5 posts’ is closed to new replies.