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>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.