Home › Forums › General Issues › get_field(); returns blank value › Reply To: get_field(); returns blank value
That is because, by the looks of things, you’re calling the function outside of the loop and ACF does not know what post to get the values from… that is unless you’re not including enough code form me to tell.
Are you’re function calls inside “the loop” or outside.
If you’re outside the loop then you can try something like this
$queried_object = get_queried_object();
$post_id = $queried_object->ID;
$forside_slagord_stor = get_field('forside_slagord_stor', $post_id);
$forside_slagord_liten = get_field('forside_slagord_liten', $post_id);
$forside_slagord_liter = get_field('om_oss_tekst', $post_id);
To be honest, I’m not sure that will work because there isn’t enough information to tell.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.