Home Forums General Issues Conflict with the Repeater and Relationship


Conflict with the Repeater and Relationship

  • I am using Shopp plugin for web catalog.

    I need to use a combination of repeater filed and relate relationship.

    When I add Relationship, the repeater data not displays. Not sure what’s wrong, when I remove the Relationship loop the repeated data displays fine.

    I use this code in the product.php file of Shopp plugin, when I use the following code in the template file, all is fine.

    I hope you could give me some advice.

    <?php if(get_field('product_assets')) { ?>
    	<?php while(the_repeater_field('product_assets')): ?>             
    		<li><a href="<?php the_sub_field('ac_title'); ?>">Brochure Download</a></li>
    	<?php endwhile; ?>
    <?php } ?>
    <?php  $posts = get_field('related_pdf'); 
    if( $posts ): ?>
    	<?php foreach( $posts as $post): ?>
    		<?php setup_postdata($post); ?>
        	<h4><a href="<?php the_field('pdf_file'); ?>"><?php the_title(); ?></a></h4>
        <?php endforeach; ?>
    	<?php wp_reset_postdata();  ?>
    <?php endif; ?>
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.