Support

Account

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');
      }
    ?>