Support

Account

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