Home › Forums › General Issues › Can't get CheckBox value with Certain Rules set? › Reply To: Can't get CheckBox value with Certain Rules set?
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:
get_field('special_news', 99);
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!
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.