Support

Account

Home Forums Add-ons Flexible Content Field Post Based On Condition of Field Reply To: Post Based On Condition of Field

  • If any fields you reference are INSIDE the flexibile content, you need to use the_sub_field() or get_sub_field() to see any content.

    I think this would be one reason why (when I tried your method), only one column of content is posting and not both. I’m only getting the second column of data because of the way I’m requesting it. So in that case, I would nee to change this

    <?php elseif( get_sub_field('columns') == "2") : ?>
                                        
                                        <div class="entry-header">
                                            <h1 class="entry-title"><?php the_title(); ?></h1>
                                        </div>
                                        <div class="blue">
                                            <div class="col-sm-6">
    											<?php the_sub_field('title'); ?>
                                                <?php the_sub_field('text_copy'); ?>
                                            </div>
    								
    								<?php endif;

    to this?
    <?php elseif( get_sub_field('columns') == "1" && == "2") : ?>

    Which doesn’t seem like a good idea to use. Based upon the way I’ve developed this:
    Fields

    There should be a more viable solution to post both columns without using ‘&&’.