Hello,
I’ve a issue on a customer website.
I want show the content of my “flexible content” of my homepage but … not success
My homepage content :
<?php if( have_rows('conteneur') ):
while ( have_rows('conteneur') ) : the_row();
the_sub_field('zone_libre');
endwhile;
endif; ?>
“conteneur” is the name of my custom field
“zone_libre” is the name of childrens field of “conteneur”
Thanks
Is this inside “The Loop”
// i.e.
if (have_posts()) {
while(have_posts()) {
the_post();
// your repeater loop here
}
}
Hi,
It’s done but not working
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_content(); ?>
<?php comments_template( '', true ); ?>
<br class="clear">
<?php edit_post_link(); ?>
</article>
<?php if( have_rows('conteneur') ):
while ( have_rows('conteneur') ) : the_row();
the_sub_field('zone_libre');
endwhile;
endif; ?>
<?php endwhile; ?>
Sorry, I’m not 100% sure what it is you’re doing. Where do you edit this flex field on the back end and what template are to trying to show them on the front end?
I use a custom template based on blankslate template
I edit this content on my homepage on backend and i want show the result on my home
what type of field is zone_libre
A Editor in a flexible content in a repeter
Solved !
<?php
if( have_rows('rep_content') ):
while ( have_rows('rep_content') ) : the_row();
if( have_rows('conteneur') ):
while ( have_rows('conteneur') ) : the_row();
the_sub_field('zone_libre');
endwhile;
endif;
endwhile;
endif; ?>