Support

Account

Home Forums Add-ons Flexible Content Field True / False in Flexible Content

Helping

True / False in Flexible Content

    • svoigts

    • February 16, 2019 at 4:12 am

    How do you reference a True / False field from a section of a Flexible Content field?

    I’m attempting to display a div outside a section inside my Flexible Content section if a True / False field is checked with in.

  • You’re explanation of what you are trying to do is not clear for me to understand, but basically you can’t reference a field in a row outside of the loop.

    
    if (have_rows('flex-field')) {
      while('have_rows('flex-field')) {
        the_row();
        if (get_sub_field('true-false-field')) {
          // do something
        }
      }
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.