Support

Account

Home Forums General Issues Relationship Field on single-cpt.php Reply To: Relationship Field on single-cpt.php

  • This works. Now just need to eliminate the current product from the list.

    $relatedImages = get_field('images', $product->ID);
    $size = 'related-product-thumbnail';
    $relatedThumb = $relatedImages['sizes'][ $size ];
    ?>
    
    <li>
    <a href="<?php echo get_permalink( $product->ID ); ?>" title="<?php echo get_the_title( $product->ID ); ?>">
    <span><img src="<?php echo $relatedThumb ?>"></span>
    <span class="related-product-title"><?php echo get_the_title( $product->ID ); ?></span></a>
    </li>