Home › Forums › General Issues › Issue displaying fields in homepage slider. › Reply To: Issue displaying fields in homepage slider.
The issue is that when you use the the_field function, ACF does not know which post to get it from! You need to specify the post_id so that ACF can correctly load the value.
You have a while loop which correctly uses the the_post
function, so within this loop, you CAN use the get_field function as per normal to store data into the array like so:
$arr[$i]["custom_field"] = get_field('custom_field');
Then just echo this out in the later loop, like you are doing for all other data.
Thanks
E
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.