Recent post in wordpress

Posted: January 29, 2013 in Uncategorized, Wordpress

<div>
<h2>Recent Blog Post</h2>
<ul>
<?php $the_query = new WP_Query( ‘showposts=5’ ); ?>

<?php while ($the_query -> have_posts()) : $the_query -> the_post();

?>

<H4><?php the_title(); ?></H4>
<b> on <?php the_time(‘F  ‘.’d ,’.’Y’) ?></b>

<p><?php echo substr(strip_tags($post->post_content), 0, 300);?> </p>
<a href=”<?php echo get_permalink($recent[“ID”]);?>”>read more…</a>
<?php endwhile;?>

</ul>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s