Error thrown
Object of class WP_Post could not be converted to string