i'm working on acf custom fields with flexible content with wordpress. I'd like to make some flexible content appear, so I use the code I found on acf website.
Then I create the fields on acf, but nothing appear.
• Here is what I made on acf : the name of the fexible content
• and here are the sub fields
This is just text area and normal texte title
• here is my code
<?php /* Template Name: ateliers */ ?>
<?php get_header(); ?>
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<?php
// check if the flexible content field has rows of data
if( have_rows('ateliers') ):
// loop through the rows of data
while ( have_rows('atelieratelier') ) : the_row();
if( get_row_layout() == 'content' ):
the_sub_field('atelier_01');
elseif( get_row_layout() == 'content' ):
the_sub_field('texte_atelier');
endif;
endwhile;
else :
// no layouts found
endif;
?>
<?php endwhile; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
</div>
</body>
</html>
Thanks for your help
0 comments:
Post a Comment