I used an ACF repeater field for data sheets/instruction manual download links of products in woocommerce. There's 50 products and each has 1 to 4 download links on their product page. I've been searching for a way to list all the links form all 50 products on one page the way you would query all posts on a page in a list. I don't even know where to start looking and I didn't see anything specific on the ACF forums.


You want to start here and here.

Essentially you're just looping through all your posts like normal and then adding some custom fields into it.

Be sure to reference the Repeater Field documentation.

This should work inside a loop. Notice you'll need your post ID.



        while ( have_rows('YOURREPEATERFIELDNAMEHERE', 'POSTIDHERE') ) : the_row(); ?>

            <li><?php echo get_sub_field('SUBFIELDNAMEHERE'); ?></li>

       <?php endwhile;

    else :

        // no rows found



    <?php endwhile; ?>
  • Thank you very much. I'll post the result for others when I get it to work. – Joe Barrett Jun 13 '19 at 15:25

I used this.


$posts = get_posts(array(
    'posts_per_page'    => -1,
    'post_type'         => 'product',
    //'orderby'         => 'title',
    //'order'           => 'DESC',
    'tax_query' => array( array(
        'taxonomy'         => 'product_cat',
        'field'            => 'slug', // Or 'term_id' or 'name'
        'terms'            =>  'winter-products' // A slug term
        // 'include_children' => false // or true (optional)

if( $posts ): ?>
    <h3>Winter Products</h3>

    <?php foreach( $posts as $post ): 

        setup_postdata( $post );
        $post_id = get_the_ID();


            <?php if( have_rows('extra_info', $post_id) ): ?> 

            <strong><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></strong> 


                <?php while( have_rows('extra_info', $post_id) ): the_row(); ?>

                    <li><a href="<?php the_sub_field('link_url'); ?>" target="_blank"><?php the_sub_field('link_title'); ?></a></li>

                <?php endwhile; ?>


            <?php endif; ?>

    <?php endforeach; ?>


    <?php wp_reset_postdata(); ?>

<?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.