Hey, I have this PHP/ACF code for WP that pulls the latest 2 entries and am wondering how to adjust this so it would just pull random entries instead. Thanks!
PHP:
function getLatestPhotos() {
if(get_field('photos', 34)) {
$latestPhotos = '<ul class="photo-list">';
$paperCounter = 0;
while(has_sub_field('photos', 34) && $paperCounter < 2) {
$latestPhotos .= '<a href="/photos/">';
$latestPhotos .= get_image_with_alt('cover', get_the_ID(), '');
$latestPhotos .= '<p>'.get_sub_field('title').'</p>';
$latestPhotos .= '<span class="name">'.get_sub_field('name').'</span>';
$latestPhotos .= '</a>';
$paperCounter++;
}
$latestPhotos .= '</ul>';
}
return $latestPhotos;
}