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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.