Support

Account

Home Forums General Issues Conflict with the Repeater and Relationship

Unread

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')) { ?>
    
    	<ul>
    	<?php while(the_repeater_field('product_assets')): ?>             
    		<li><a href="<?php the_sub_field('ac_title'); ?>">Brochure Download</a></li>
    	<?php endwhile; ?>
        
        </ul>
    <?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; ?>
    </ul>
    	<?php wp_reset_postdata();  ?>
    <?php endif; ?>
Viewing 1 post (of 1 total)

The topic ‘Conflict with the Repeater and Relationship’ is closed to new replies.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.