Home Forums General Issues Nested relationship fields won't print the_content


Nested relationship fields won't print the_content

  • Relationships fields work, query_posts works but only for the title. I need the content to print, but nothing shows up. I looked at reset query and had no luck. Any ideas, appreciated…

    <?php query_posts( array(
    'worlds' 	=> 'old-world',								
    'orderby'	=>	'menu_order title',
    'order' 	=> 'ASC'
    )); ?>
    <h1>OLD WORLD</h1>
    <?php if (have_posts()): while(have_posts()):the_post();?>
    <!-- Name of Producer -->
    <li>																				<h2><?php the_title(); ?></h2>
    <?php $posts = get_field('country_producer_relationship');				 
    if( $posts ): ?>
    											<ul class="item">																							<?php foreach( $posts as $post): ?>													<?php setup_postdata($post); ?>											    <li>													    <h4><?php the_title(); ?></h4>												    	<?php the_field('producer_description'); ?>													    	<?php the_content(); ?>				    																<!-- Name of Producer -->
    														<?php $posts2 = get_field('producer_product_relationship');														if( $posts2 ): ?>															<ul id="wine-listing" class="item">																<?php foreach( $posts2 as $post): ?>																	<?php setup_postdata($post); ?>																	    <li>																	    	<a href="<?php echo the_permalink(); ?>">																	    		<strong><?php the_title(); ?></strong>																	    	</a>																	    	<?php if( get_field('price') ): ?>																	    		<?php the_field('price'); ?>																	    	<?php endif; ?>&nbsp;																		    	<?php if( get_field('availability') ): ?>																	    		<?php the_field('availability'); ?>																	    	<?php endif; ?>&nbsp;																		    	<?php if( get_field('vintage') ): ?>																	    		<?php the_field('vintage'); ?>																	    	<?php endif; ?>																	    </li>																<?php endforeach; ?> 																						</ul><!-- end wine-listing -->															<?php wp_reset_postdata();?>														<?php endif; ?><!-- end producer-wine relationship -->     													    </li>												<?php endforeach; ?>											</ul>											<?php wp_reset_postdata();?>										<?php endif; ?><!-- end country-producer relationship -->
    <?php endwhile; else: ?>								
    <?php endif; wp_reset_query(); ?>
Viewing 1 post (of 1 total)

The topic ‘Nested relationship fields won't print the_content’ is closed to new replies.