Support

Account

Home Forums General Issues Nested Relationships Reply To: Nested Relationships

  • Unfortunately, that did not fix the issue. Here is the updated code:

    <?php
    $featured_posts = get_field('product_cameras');
    if( $featured_posts ): ?>
    <div class="row justify-content-left">
            <?php foreach( $featured_posts as $featured_post ): 
            $title = get_the_title( $featured_post->ID );
            $image = get_the_post_thumbnail_url( $featured_post->ID, 'thumbnail' );
            $pdf = get_field( 'product_spec_sheet', $featured_post->ID );
            $manufacturer = get_field( 'product_manufacturer', $featured_post->ID );
            $logo = get_field( 'manufacturer_logo-darkbg', $manufacturer->ID );
            $manuname = get_the_title( $manufacturer->ID );
            ?>
                <div class="col col-sm-3 pb-5"> 
                   <div class="card h-100 product-card product-card--camera clear-styles">
                     
    <div class="card-body product-card--image">
                     	<img src="<?php echo esc_html( $image ); ?>" class="pb-4">
    <?php if( $manufacturer ): ?> 
    <img src="<?php echo esc_url( $logo['url'] ); ?>" style="max-height:25px;">
    <p><?php echo esc_html( $manuname ); ?> <?php echo esc_html( $title ); ?>
    <?php endif; ?>
    <?php if( $pdf ): ?>
    	  <a href="<?php echo get_site_url(); ?><?php echo esc_html( $pdf ); ?>" target="_blank"><i class="fas fa-info-circle"></i></a>
    <?php endif; ?>
    </p>
    </div>
                   </div>
                </div>
            <?php endforeach;  ?>
    </div>
    <?php endif; ?>

    Visually, it’s unchanged.