Home › Forums › Front-end Issues › All ACF Data Not Loading / Sporadic › Reply To: All ACF Data Not Loading / Sporadic
You also mentioned something about a rand function. I have the following on a few sites but not every site I am having the problem with is using this function. Either way can you take a look and let me know if there is anything mal-formed that I need to be concerned about?
<div class="praise">
<?php
$rows = get_field('book_praise', 'option' );
$rand_row = $rows[ array_rand( $rows ) ];
$rand_row_comment = $rand_row['praise_comment' ];
$rand_row_name = $rand_row['praise_name' ];
$rand_row_org = $rand_row['praise_org' ];
?>
<div class="review">
<span class="quote_top">“</span><span class="comment"><?php echo $rand_row_comment; ?></span><span class="quote_bottom">”</span>
<div class="clear"></div>
</div>
</div>
<div class="attribute">
<span class="quote_bar"><img src="<?php echo(THESIS_USER_SKINS_URL); ?>/mobile-first/images/quote_bar.png" alt="Publications" /></span>
<span class="name">~ <?php echo $rand_row_name; ?></span>
<span class="org"><?php echo $rand_row_org; ?></span>
</div>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.