WordPress.org

Support

Support » How-To and Troubleshooting » How to display earlier posts instead of latest posts

How to display earlier posts instead of latest posts

  • Hi,
    How can I display earlier or first entered posts instead of latest posts.
    Here is my code:

    <table cellpadding="0" cellspacing="0" border="0">
        	<?php $recent = new WP_Query("cat=8&showposts=2"); while($recent->have_posts()) : $recent->the_post();?>
        	<tr>
            	<td style="padding:10px 0;">
                <?php if (has_post_thumbnail( $post->ID ) ){ ?>
    									<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    									<img src="<?php echo $image[0]; ?>" width="198px" height="96" />
    									<?php }else { ?>
    									<img src="<?php bloginfo('template_url'); ?>/images/event-image.jpg" width="198px" height="96" />
    									<?php } ?>
                </td>
                <td valign="middle" style="vertical-align:middle; padding:0 10px;">
                	<?php the_title(); ?><br />
        <a href="<?php the_permalink() ?>" rel="bookmark"class="whitelink">Click here to read more</a>
                </td>
            </tr>
            <?php endwhile; ?>
        </table>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to display earlier posts instead of latest posts’ is closed to new replies.
Skip to toolbar