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!
© 2022 Advanced Custom Fields.