Support

Account

Home Forums General Issues Pulling Custom Post Data into a Loop – using it throughout the loop Reply To: Pulling Custom Post Data into a Loop – using it throughout the loop

  • Hi Amber

    You certainly saved me some time …

    The only tweak I needed to make to your code was for one section where I allowed multiple Post Objects to be selected – using your example I added an s to – $containers and using foreach $containers as $container – to allowed me to display multiple records (prob no use for base price but if you were showing say – container colors or something you could select multiple and they would all show)

    
    <?php $containers = get_field('container'); foreach( $containers as $container): if( $container ): ?>
    <p class="price">$<?php the_field('base_price', $container); ?>+</p>
    					<?php endif; ?>
                                            <?php endforeach; ?>
    

    Thanks Again

    All the best
    Brad