query_posts();
while (have_posts()) : the_post();
if(has_post_thumbnail())
the_post_thumbnail('medium');
else {
$photos = get_children(array('post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'));
if ($photos) {
$photo = array_shift($photos);
echo wp_get_attachment_image($photo->ID, 'medium');
}
}
echo '<h2 class="entry-title"><a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_title().'</a></h2>';
the_excerpt();
endwhile;
wp_reset_query();
この質問をwordpress.stackexchange.comに移動してください – amolv