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
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; ?>
The topic ‘Get flexible content’ is closed to new replies.
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.