Support

Account

Home Forums Front-end Issues CPT Loop not returning get_field but does get_post_meta Reply To: CPT Loop not returning get_field but does get_post_meta

  • Hi @idealien

    I see 2 issues with your above code:
    1. Your post_meta function use the $post->ID, however your get_field does not
    2. Your setup_postdata() function may be causing the issue.

    Does your line work correctly:

    
    $output .= "<strong>ID: " . $post->ID . "</strong><br/><br/>";
    

    Can you also read over the WP docs to see some code examples of loops. Perhaps the get_posts function will be clearner?

    Thanks
    E