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

  • @mediawerk thanks for your answers.

    My code is indeed a flexible field and when I put the code which I am trying to put in a separate file, into my whole code, it works. It’s just that when I put it out of the context or I try to call it from a function, it doesnt work anymore.

    I don’t know if it makes so much sense to put my entire code, but here it is:
    http://pastebin.com/vC6b4fXw

    I want to put in a separate file everything that is inside the <figcaption>tag (or create a function that will load that code). My problem so far is, that if I put this code in a template file and I call it with a normal <?php get_template_part(); ?> or with a function via functions.php for example, my caption appears empty. While if I leave it inside my main loop, the captions are there.