ACF & Theme Code Pro – Display Group Clone

Question

I have a group named background that contains two fields :
background_color (type: Select)
dots_texture (type: True / False)

This group is called as a clone in another group called background_options.

When I call it I use prefixed named and I choose the option Display: Group so I can have Wrapper Attributes :
enter image description here

According to ACF, choosing this option changes the way we retrieve clone fields values :
enter image description here

Theme Code Pro doesn’t seem to adapt when the display: group option is selected, generated code remains the same :

<?php if ( have_rows( 'background_options_background' ) ) : ?>
   <?php while ( have_rows( 'background_options_background' ) ) : the_row(); ?>
      <?php the_sub_field( 'background_color' ); ?>
         <?php if ( get_sub_field( 'dots_texture' ) == 1 ) { 
            // echo 'true'; 
         } else { 
            // echo 'false'; 
         } ?>
   <?php endwhile; ?>
<?php endif; ?>

I can’t figure how to make it work, so I’m stuck here.

Has anybody already been in this particular case ?

0
Guillaume Gautier 4 months 0 Answers 12 views 0

Leave an answer