Support

Account

Home › Forums › ACF PRO › Retrieve data from post-object them the post has been created with ACF comp. › Reply To: Retrieve data from post-object them the post has been created with ACF comp.

  • You just need to supply the post ID for WP and ACF. Going by your code

    
    // use a wp function 
    $excerpt = get_the_excerpt($news->ID);
    // use an acf field
    $value = get_field('field_name', $news->ID);
    

    I am assuming from your code that you are using a post object field. You can also use setup_postdata() as explained in the documentation.