I have created a True/False ACF field called ‘custom_acf’ and im trying to do an if statement where if its true it shows something, and if false shows something else. Below is what i have, but it is displaying as false whether the the true/false is ticked or not. Where am i going wrong?
Could you please make sure that the get_field() function returns the correct value? Could you please debug it like this:
var_dump( get_field('custom_acf') );
If that doesn’t return the correct data, it’s possible that the get_field() function is loaded outside of The Loop. In this case, could you please pass the post ID to the get_field() function like this:
Where ’99’ is the post ID.
If still no joy, could you please share the JSON or XML export file of your field group so I can check your setup?
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users