Display WordPress Recent Posts Without Using any plugin

There are a lots of wordpress plugins which display recent posts. We can also display recent posts without using any plugin in wordpress. Here is wordpress Code Snippet to Create a function and then call function where you want to display wordpress recent posts.
Put the following function in theme functions.php

After you’ve made the function. Put the following in the sidebar or wherever you like the recent posts to list..

Please comment and share if you like this.