I have this working as I wanted now, for future reference I will share the code I used which I adapted from Russ’ answer here. Add this to your single-cpt.php file in your template theme, or create one if you don’t already have one.
<?
$child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'CPT' ORDER BY menu_order", 'OBJECT');
if ( $child_pages ) :
foreach ( $child_pages as $pageChild ) :
setup_postdata( $pageChild );
$thumbnail = get_the_post_thumbnail($pageChild->ID, 'thumbnail');
if($thumbnail == "") continue; // Skip pages without a thumbnail
?>
<div class="child-thumb">
<a href="<?= get_permalink($pageChild->ID) ?>" rel="bookmark" title="<?= $pageChild->post_title ?>">
<?= $pageChild->post_title ?><br /><?= $thumbnail ?>
</a>
</div>
<?
endforeach;
endif;
?>
Replace where it says post_type = ‘CPT’ with your own custom post type name and if you want to make an image slider like I did change the div child-thumb to match the layout required by the slideshow or carousel you are using.
In order for this solution to work you must set Hierarchial to true and supports must include page-attributes within the CPT settings in your functions.php file ie:
'hierarchical' => true 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'),
You will also want to set your post type to be ordered by menu order by adding this to your functions.php file
//Order custom post type by menu order (must have supports page-attribute)
function CPT_archive_order( $vars ) {
if ( !is_admin() && isset($vars['post_type']) && post_type_supports($vars['post_type'], 'page-attributes') ) {
$vars['orderby'] = 'menu_order';
$vars['order'] = 'ASC';
}
return $vars;
}
add_filter( 'request', 'CPT_archive_order');
I hope that helps some else in the future.
Spacechimp out