WordPress.org

Ready to get started?Download WordPress

Forums

How to display the latest 5 posts (2 posts)

  1. aleks77
    Member
    Posted 1 year ago #

    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>
  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    please post the full code of the template;

    best use the pastebin - see http://codex.wordpress.org/Forum_Welcome#Posting_Code

Topic Closed

This topic has been closed to new replies.

About this Topic