Office Address

41/D, West Brahmondi, Narsingdi

Phone Number


Email Address

There are some plugins for Recent post but i love the coding way.Just paste this code in your side bar.


<h3><?php _e( ‘Recent Posts’ ); ?></h3>

$the_query = new WP_Query(‘showposts=5&orderby=post_date&order=desc’);
while ($the_query->have_posts()) : $the_query->the_post();

<div class="latest_post">

<div class="image_holder" >
<?php the_post_thumbnail(array(50,50), array (‘class’ => ‘alignleft’)); ?>

<div class="recent_description">
<h4><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php echo get_the_date(‘m/d/y’); ?> – <?php the_title(); ?></a></h4>

<?php the_excerpt(); ?>


<?php endwhile; ?>

<?php wp_reset_query(); ?>?


Thats it! You get your cool recent post links with thumbnail.Now if you want to show only 20 word in your description then pasteĀ  this code in the function.php of your theme.

[php] function new_excerpt_length($length) {
return 20;
add_filter(‘excerpt_length’, ‘new_excerpt_length’);

Now you can add some css to look it cool.

[php] /* recent post */
.image_holder{ float:left; width: 80px;}
float: left;
padding: 5px;
Written by

Maidul Islam

I am a freelance web developer.Like to share what i learn.