Created
October 10, 2015 17:07
-
-
Save mattradford/5ea826f5fa6207c7b583 to your computer and use it in GitHub Desktop.
Super-easy get random ACF repeater row :)
Improved to match HTML5 spec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$repeater = get_field( 'testimonial','options' ); | |
$rand = rand(0, (count($repeater) - 1)); | |
echo '<blockquote><p>'.$repeater[$rand]['quote'].'</p>'; | |
if (!empty($repeater[$rand]['citation'])) { echo '<cite>'.$repeater[$rand]['citation'].'</cite>';}; | |
echo '</blockquote>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment