Support

Account

Home Forums General Issues show images of relationship custom post Reply To: show images of relationship custom post

  • Hi @manucnx

    Since you’re not in a real loop you need to specify the second parameter for each function call:

    
    <?php 	
    $posts = get_field('brand_hp');
    if( $posts ): ?>
    	<?php foreach( $posts as $client ): ?>
    		<?php 
    		$logo_hover = get_field('logo_hover', $client->ID);
            $logoclient = get_field('logo', $client->ID);
    		?>
    	    <div class="brand">
    	    	<a href="<?php echo get_permalink( $client->ID ); ?>">
    				<img class="img-cliente" src="<?php echo $logoclient['url']; ?>" alt="<?php echo $logoclient['alt']; ?>" />
                	<img src="<?php echo $logo_hover['url']; ?>" alt="<?php echo $logo_hover['alt']; ?>" />
    			</a>
            </div>
    	<?php endforeach; ?>
    <?php endif; ?>