<?php if ( have_posts() ) : while ( $fullbanner->have_posts() ) : $fullbanner->the_post(); ?>
#####Get the relationship field
<?php $banners = get_field(‘home_banner_01_selection’); ?>
#####Check if the relationship field has contents
<?php if( $banners ): ?>
<?php foreach( $banners as $banner ): ?> ID ); ?>”><?php the_field( ‘home_headline’, $banner->ID ); ?>
<?php endforeach; ?>
<?php endif; ?>
I have three contents added in this relationship field. I want just to display ONLY ONE content per page and randomize it when refreshing the page. At the moment it is currently display all the three contents in the page.
I notice that the var $banners behave as an array. If I add echo count($banners); it will display 3. Moreover, if I add shuffle($banners); it will shuffle the content among them.