Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

setup_postdata not working

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();
 
PREVIOUS NEXT
Tagged: #working
ADD COMMENT
Topic
Name
6+1 =