Home › Forums › Add-ons › Flexible Content Field › Flex Content in Repeater › Reply To: Flex Content in Repeater
Hi @robertrhu
I’m sorry I think I made a mistake in my last answer. If the add_resorts_hero_slider_video
and the add_resorts_hero_slider_image
fields are located inside the flexible content, you should be able to do it like this:
<!--ORBIT SLIDE-->
<?php
if (have_rows('add_resorts_hero_image_slide', 'option')) {
while (have_rows('add_resorts_hero_image_slide', 'option')) {
the_row();
if (have_rows('choose_resorts_hero_slider_content')) {
while (have_rows('choose_resorts_hero_slider_content')) {
the_row();
echo '<li class="orbit-slide">';
if( get_row_layout() == 'resorts_slider_video' ){
$herovideo = get_sub_field('add_resorts_hero_slider_video');
echo $herovideo;
} elseif( get_row_layout() == 'resorts_slider_video') {
$heroimage = get_sub_field('add_resorts_hero_slider_image');
echo '<img src="' . $heroimage['url'] . '" />';
}
echo '</li>';
}
}
}
}
?>
<!--END ORBIT SLIDE-->
To learn how to use image field, please check this page: https://www.advancedcustomfields.com/resources/image/.
If that code doesn’t work, kindly share the JSON export file of your field group so I can test it on my installation.
Thanks 🙂
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN
— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.