Home › Forums › General Issues › How to call ACF fields from my functions.php file › Reply To: How to call ACF fields from my functions.php file
if you put full code(that you show us) in a separate file and only captions are empty, then problem is somewhere else.
because you will/should see nothing or everything.
i assume you have a flexible-field or repeater field, and inside that you have:
1 image field (image), and 2 text-fields (title and caption)?
or do you only have 1 image field and try to use caption and title of it? if it is like that, then use:
$title = $image['title'];
$alt = $image['alt'];
$caption = $image['caption'];
instead of get_sub_field for title and caption
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.