My code
<?php if( have_rows('mir_global_header') ): ?>
<div id="mid-bg1">
<div id="top-container1">
<?php while( have_rows('mir_global_header') ): the_row();
$count = get_row_index();
$header_image = get_sub_field('header_image');
$header_image_text = get_sub_field('header_image_text');
?>
<img src="<?php echo $header_image; ?>" id="<?php echo $count; ?>" alt="<?php echo $header_image_text; ?>" />
<?php endwhile; ?>
</div>
</div>
<?php endif; ?>
I’ve done everything as mentioned in the documentation. It’s not working. Is it because ACF pro is not activated? Is there any other way to do this? Thanks in advance
2
Answers
Are your fields in an options page or a classic post_type?
Test this for print a result
PS : ACF Gallery gives the same result 😉
https://www.advancedcustomfields.com/resources/gallery/
If you’re using ACF options page. You have to specify that in the
have_rows
. https://www.advancedcustomfields.com/resources/get-values-from-an-options-page/