almaz-b
5/30/2017 - 7:39 PM

Posts output

Posts output


<?php 

$posts = get_field('product-siblings');

if( $posts ): ?>

<div class="item__more">
    <div class="item__title title"><span>Другие наборы из этой серии</span></div>
    <div  class="item__more__carousel">
	    <?php foreach( $posts as $post): // variable must be called $post (IMPORTANT) ?>
	        <?php setup_postdata($post); ?>

		        <a href="<?php the_permalink(); ?>" class="item__more__item" product-id="139">
		            <img src="/wp-content/uploads/2017/02/freestyle.jpg">
		            <div class="item-modal__more__name"><?php the_title(); ?></div>
		        </a>

	    <?php endforeach; ?>
    </div>
</div>

    <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
<?php endif; ?>