Skip to content

Instantly share code, notes, and snippets.

@rickalee
Created November 21, 2013 20:22
Show Gist options
  • Save rickalee/7588915 to your computer and use it in GitHub Desktop.
Save rickalee/7588915 to your computer and use it in GitHub Desktop.
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