Error when using setup_postdata()
You are getting the error because, by default, wp_get_recent_posts returns an array of posts (due to backward compatibilty) and not the required WP_Post object which is required to setup the template tags. Look at the source code, and you will see that wp_get_recent_posts is a simple wrapper function for get_posts (which is just a wrapper … Read more