Home › Forums › Add-ons › Repeater Field › Display and shuffle all repeater sub fields of all posts › Reply To: Display and shuffle all repeater sub fields of all posts
Forgot to paste this:
<?php
$args = array (
'post_type' => 'post',
'posts_per_page' => -1,
'meta_key' => 'project',
'orderby' => 'rand',
'meta_compare' => 'EXISTS' );
$query = new WP_Query($args);
while ($query->have_posts()): $query->the_post();
if (have_rows('project')) {
while(have_rows('project')) {
the_row();
?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_sub_field('image'); ?>"></a>
<?php
}
}
endwhile;
wp_reset_query();
?>
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!
🎉ACF has made it into the latest round of the @TheTorqueMag Plugin Madness!
— Advanced Custom Fields (@wp_acf) March 22, 2023
🙏 Please swing by and vote for ACF in the latest matchup.
🙌 Each round lasts one week, but you can vote twice each week. Make sure to get both your votes in!https://t.co/iTpRE82O1k
© 2023 Advanced Custom Fields.
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.