Home › Forums › Front-end Issues › Multiple taxonomy terms, but only show one random result › Reply To: Multiple taxonomy terms, but only show one random result
Assuming the OPer has moved on after 2 years, this is for anyone looking for similar information.
<?php
// get selected people
$people = get_field('service_expert');
if ($people) {
$person = array_rand($people);
// the rest of this would depend on what type of field it is
// I'm assuming a relationship field
// and that you are returning a array of post object
get_the_post_thumbnail($person->ID, 'person-thumb');
}
?>
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.