Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Random Testimonial using Advanced Custom Fields Options Page
<?php
$rows = get_field( 'testimonials', 'option' );
$row_count = count($rows);
$i = rand(0, $row_count - 1);
echo '<blockquote><p>' . $rows[$i]['quote'] . '</p>';
echo '<cite>' . $rows[$i]['cite'] . '</cite></blockquote>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment