Home Forums ACF PRO Post Object within taxonomy. Reply To: Post Object within taxonomy.

  • This code` <?php

    $posts = get_field(‘related_series’, $taxonomy . ‘_’ . $term_id);

    if( $posts ): ?>
    <?php foreach( $posts as $p ): // variable must NOT be called $post (IMPORTANT) ?>
    <a href=”<?php echo get_permalink( $p->ID ); ?>”><?php echo get_the_title( $p->ID ); ?><?php the_post_thumbnail( ‘featured’ ); ?></a>

    <?php endforeach; ?>
    <?php endif; ?>`

    I used the example link:
    And I added to get the featured image from the related post. However, he repeats the same image for all posts. This is not a repeater field. I’m doing the test without the repeater field.