Query Child Pages of a Current Page and Loop Through Each Child Page
-
Hello all,
For some reason this loop is generating the same custom field images on all my pages who are assigned this template. I believe my problem is I shouldn’t assigned a post parent with an id of 55 because that page is correct but the rest are not. Not sure how to get this code correct. Please help, it would be very much appreciated : ) The following code is what I have on my page template:
<?php query_posts("posts_per_page=-1&post_type=page&order=asc&post_parent=55"); if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <figure><a href="<?php the_permalink(); ?>"><img src="<?php echo get_post_meta($post->ID, "detail_thumbnail", true); ?>" alt="" /></a></figure> <?php endwhile; wp_reset_query(); ?> </section> <?php endwhile; endif; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Query Child Pages of a Current Page and Loop Through Each Child Page’ is closed to new replies.