Support

Account

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

Helping

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) ): ?>
    
        <ul>
    
        <?php while( have_rows('gallery_images',$post->ID) ): the_row(); ?>
            
    <li><?php the_sub_field('image'); ?></li>
       
     <?php endwhile; ?>
      
      </ul>
    
    <?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)

The topic ‘Repeater field not showing sub_field in category archive page’ is closed to new replies.