Support

Account

Home Forums Front-end Issues Can't continue query after calling post object field Reply To: Can't continue query after calling post object field

  • The reason this is happening is that when you call wp_reset_postdata(); the post data is being reset to the main post that would be displayed on the page and not the post associated with your secondary loop.

    You’ll need to not use

    
    $post = $post_object;
    setup_postdata($post); 
    

    and use an alternate method to get data for your post object, for example

    $title = get_the_title($post_object->ID);