The values of custom fields are not available functions.php
This is because you’re doing it too early. You need to wrap your code in the necessary hook so that it occurs at the correct time. Because you don’t tell get_field the ID of the current post, it needs to know which post to get the field from, and it does this by referencing the … Read more