Ok, I tried every solutions, searched Google and Codex, I can’t find the missing bit of code I need for the following scenario :
- Created a page (Models) that list all 1st child pages under it and display the title, links, custom fields and post thumbnail. (This work perfectly.)
- While looping these child pages, I need to link in each listing to all grand child of these pages.
Visual
- Models
[LIST] - Porsche 911 GT3
[LIST] - Features
- Technical Specs
- Gallery
[/LIST] - Porsche 911 GT3 RS
[LIST] - Features
- Technical Specs
- Gallery
[/LIST]
[…]
[/LIST]
<ul class="list">
<?php $pageChildren = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?>
<?php if ( $pageChildren ) : foreach ( $pageChildren as $pageChild ) : setup_postdata( $pageChild ); ?>
<li>
<div class="left">
<?php echo the_post_thumbnail($pageChild->ID); ?>
<div class="hover">
<a href="<?php echo get_permalink($pageChild->ID); ?>">Details</a> <a href="#">Request a Quote</a>
<span class="small">MSRP: <?php echo get_post_meta($pageChild->ID,'msrp', true); ?></span>
</div>
</div>
<div class="right">
<h5><?php echo $pageChild->post_title; ?></h5>
<p><?php echo get_post_meta($pageChild->ID,'small-desc', true); ?></p>
<div class="links">
<ul>
<li><a href="#">Features</a> </li>
<li><a href="#">Technical Specs</a> </li>
<li><a href="#">Gallery</a> </li>
<li><a href="#">Compare</a> </li>
</ul>
</div>
</div>
<div class="clearfix"></div>
</li>
<? endforeach; endif; ?>
</ul>
So into the div with a class of “links”, I need to list the child pages of each listing.
Any one ?