Home Forums Add-ons Repeater Field Repeater field not showing sub_field in category archive page


Repeater field not showing sub_field in category archive page

  • HI,
    I’m pulling my hair trying to figure out why my repeater loop:

    <?php if( have_rows('gallery_images', $post->ID) ): ?>
        <?php while( have_rows('gallery_images',$post->ID) ): the_row(); ?>
    <li><?php the_sub_field('image'); ?></li>
     <?php endwhile; ?>
    <?php endif; ?>

    Works on the Posts Archive page and single category page but not on the category archive page.

    get_field works and the_field of the repeater name returns the number of rows in my repeater but it will not spit out my repeater image urls.

    I am actually just trying to show the first row, but I settle for getting any image url to show up.

  • Hi @gray444

    Could you please let me know the result of your code and the following code?

    echo "<pre>";
    print_r( get_field('gallery_images', $post->ID) );
    echo "</pre>";

    If that doesn’t work, please set the ID manually like this:

    print_r( get_field('gallery_images', 99) );

    Where ’99’ is the post ID.

    Also, could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.

    Thanks 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.