Support

Account

Home Forums Add-ons Flexible Content Field Flex duplicate content Reply To: Flex duplicate content

  • Hi James,

    Understand where you’re coming from but this didn’t fix the issue. Used code:

    <?php if( have_rows('digital_sections') ): ?>
        
        <style>  
            .photo-box {
                  -webkit-background-size: cover;
                  -moz-background-size: cover;
                  -o-background-size:  cover;
                  background-size: cover;
    
            }
            .fore-image {
                   background-size: contain;
            }
        </style>
        
        <?php while ( have_rows('digital_sections') ) : the_row();?>
    
            <?php if( get_row_layout() == 'hero_images' ); ?>
            <header class="container-fluid photo-box" style="background: url(<?php the_sub_field('hero_image'); ?>) no-repeat center center fixed;">
                <div class="fore-image" style="background: url(<?php the_sub_field('fore_image'); ?>) no-repeat center;"></div>
            </header>        
    
    <?php endwhile; endif; ?>

    And now everything within the <?php while ( have_rows('digital_sections') ) : the_row();?> is repeated and the first set still empty?

    Resulting code:

    <header style="background: url() no-repeat center center fixed;" class="container-fluid photo-box">
                <div style="background: transparent url("") no-repeat scroll center center; transform: translate(0px, -4.5%);" class="fore-image"></div>
            </header>
    <header style="background: url("http://localhost/startup/wp-content/uploads/2016/06/sg-bg-2.jpg") no-repeat center center fixed;" class="container-fluid photo-box">
                <div style="background: transparent url("http://localhost/startup/wp-content/uploads/2016/06/fore-image.png";) no-repeat scroll center center;" class="fore-image"></div>
            </header>