Home › Forums › Front-end Issues › ACF with enfold theme › Reply To: ACF with enfold theme
Hi @dannhanks
The get_field() function needs the post ID to be passed as the second parameter if you call it outside The Loop. It should be something like this:
get_field('excerpt', 99);
Where ’99’ is the ID of your post. There’re several ways to get the post ID outside The Loop. One of them is by using the post global variable like this:
global $post;
$post_ID = $post->ID;
Then you can use it for the get_field() function like this:
get_field('excerpt', $post_ID);
I hope this helps 🙂
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.