What do I need to do to display thumbnail + tags + title of a child page?
[ Thumbnail ]
[ Title ]
[ Tags ]
Thanks!
EDIT:
Well this work, but only showing thumbs+title… it shouldnt be too difficult to add the tags:
<?php
$child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?>
<?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild ); ?>
<div class="child-thumb">
<a href="<?php echo get_permalink($pageChild->ID); ?>" rel="bookmark" title="<?php echo $pageChild->post_title; ?>"> <?php echo get_the_post_thumbnail($pageChild->ID, 'thumbnail'); ?></a><br />
<a href="<?php echo get_permalink($pageChild->ID); ?>" rel="bookmark" title="<?php echo $pageChild->post_title; ?>"><?php echo $pageChild->post_title; ?></a><br />
</div>
<?php endforeach; endif;
?>
Assuming that you’ve enabled support for both post thumbnails and post tags for static Pages, I would use
WP_Query()
to build your query, and do something like the following:Note that I’ve not included any failsafes, such as checking for
has_post_thumbnail()
, etc.