• im trying to add some code when a true/false ACF checkbox is checked, i tried this shortcode:
    [if field mobile checkbox=”mobile” value=”1″]its mobile[/if]

    but it wont work, when the box is checked and I use this shortcode:
    [field mobile]
    it gives me “1”.
    Apparently the problem is that i dont have the name of the checkbox, so im guessing by calling it the same way as the field, what would be the name of that true/false ACF checkbox or how would i achieve this function?

    https://wordpress.org/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    You can find the exact name/slug of the field by going to Dashboard -> Content, or in ACF’s field settings.

    Once you have the field name, you can see if it’s checked/true, like this:

    [if field="mobile" value="1"]
      It's mobile.
    [else]
      It's not mobile.
    [/if]
Viewing 1 replies (of 1 total)

The topic ‘ACF Checkbox true/false’ is closed to new replies.