setup_postData no funciona

global $post; //important
$posts = get_posts($args);
  foreach($posts as $post) { //should be $post not $p etc
    setup_postdata($post);
    the_title();
  }
  wp_reset_postdata();
Dreamy bird