• Hello,

    I have two nested loops inside my main content loop, and the nested loops appear to be preventing my meta content from showing up.

    The nested loops inside my main WP loop are pulling in content from a Custom Post Type.

    Here’s my code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    My second set of meta data (quote and testimonial_author) is not showing up. However, if I remove the first custom post type loop it shows up just fine. I’m guessing there is something wrong with my loop.

    Any ideas on why my nested loop is preventing the additional meta data from appearing on the page?

    Thanks in advance for any insight.

    P.S. I asked this question before but I don’t think my post was clear enough. That post can be found here.

Viewing 1 replies (of 1 total)
  • I think your secondary loops are stepping on the_post(). Try saving the main post ID and using it in the calls to get_post_custom_values, like this:

    <div class="left">
    
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
       <?php $main_id = the_ID(); ?>
    <!-- pull in additional Home page meta data in sidebar -->
    
    	<div id="testimonial">
    	<?php
    
    	$mykey_values = get_post_custom_values('quote',$main_id);
Viewing 1 replies (of 1 total)
  • The topic ‘Meta Content Disappearing with Nested Loops’ is closed to new replies.