Could you please tell me where did you put the code? Please keep in mind if you set the rule to “Post Category <=> is equal to <=> Category name”, then you need to execute the code in the single.php file.
If you have Front page displays option set on “wp-admin > Settings > Reading” and set the rule to “page”, then executing it on the front page template would be possible. Another method is to set the rule to “Page Type <=> is equal to <=> Front Page”
If you need to get the value on other pages where the fields are not assigned, you can pass the post ID instead. So, for example, if your front page has an ID of 99, you can get the value anywhere by using this code:
If those are not what you want, could you please explain your query in more detail?
I hope this makes sense 🙂
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!
© 2023 Advanced Custom Fields.