Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Awesome. This came in VERY handy. Exactly what I needed.
    I’m learning so much PHP via wordpress as an applicable example.
    THANK YOU BOTH!

    you want to use this to avoid the double looping.

    <div class="maincontent">
                   <?php the_ID(); ?>
                   <?php $parent = $post->ID; ?>
    <?php
    query_posts('post_type=page&post_parent='.$parent);
     while (have_posts()) : the_post();
    ?>
    
    <div class="imagelisting">
    <div class="Image">
        <?php $image = get_post_meta($post->ID, 'spots_img', true); ?>
     </div>
      </div>
    <?php endwhile; ?>
    </div>

    the query-posts is itself, a loop.

    There is no need to call the standard loop to set other php calls like
    <?php the_ID(); ?> or <?php $parent = $post->ID; ?>

Viewing 2 replies - 1 through 2 (of 2 total)