I’d like to take all the items from a relationship field and randomly display only one (with it’s associated fields).
For example, I have a field group titled Featured Team Member, with fields such as team member name, image, position, etc.
I’d like to be able to select a list of Team Members, and then each time the page loads have one of them display.
I’ve been able to get the entire list to display, but not been able to use the random query.
I’ve seen code like below, but am not sure how to make it work:
$post_object = get_posts(array(
‘orderby’ => ‘rand’,
‘posts_per_page’ => ‘1’
));
Any help would be great, thanks!