When we are work with wordpress theme. So many times we want to show recent posts without wordpress plugin in wordpress theme. Many people suggest to use wordpress plugin for showing the recent post.
How to show recent posts without wordpress plugin
But I suggest not to use any wordpress plugin for showing the recent posts in wordpress theme.
In this tutorial I will tell very simple technique to show recent posts. Following code you can use in your sidebar.php or in footer.php or anywhere as per your theme requirement.
Just put following code in your theme file. You just need to change the showposts count as per choice.
<?php $recent_posts = new WP_Query('showposts=15'); while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?>
Your recent post will look this. You just need to customize css as per your wordpress theme.