Support

Account

Home Forums General Issues Creating post with Gravity forms, get_fields($post_ID) are kind of empty. Reply To: Creating post with Gravity forms, get_fields($post_ID) are kind of empty.

  • I think the problem is your variable: $post_ID. Maybe try calling the global $post object and then using $post->ID like so:

    
    <?php // get WP global post object
    global $post;
    
    // you could add a query here to limit your results
    get_fields($post->ID);
    
    // Also if you are grabbing multiple fields you might need to loop through them
    $fields = get_fields($post->ID);
    
    foreach ($fields as $field) {
       // do something with each post
    }
    

    Not sure if that is exactly what you’re looking for.