Added recent_posts function

Generate an array of recent posts for the sidebar.