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.
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.