Don,
您必须在函数中添加对缩略图的支持。php/插件文件。php
//Add Support for Thumbs
if ( function_exists( \'add_theme_support\' ) ) {
add_theme_support( \'post-thumbnails\' );
set_post_thumbnail_size( 960, 276, true ); // default Post Thumbnail dimensions
}
//Add Thumbnail sizes
if ( function_exists( \'add_image_size\' ) ) {
add_image_size( \'large-thumb\', 960, 276, true ); //960 pixels wide x 276 height and cropping
add_image_size( \'medium-thumb\', 605, 174 ); //No crop
add_image_size( \'small-thumb\', 288, 83, true );
}
从这里,您可以修改循环中的此输出,以满足您的需要:
<?php if ( has_post_thumbnail() ) {
echo \'<a href="\' . get_permalink( $post->ID ) . \'" title="\' . esc_attr( $post->post_title ) . \'">\';
echo get_the_post_thumbnail($thumbnail->ID, \'small-thumb\', array( \'alt\' => esc_attr( $post->post_title ), \'title\' => esc_attr( $post->post_title ) ));
echo \'</a>\'; //Change the \'small-thumb\' to whichever size you would like.
}
希望这能帮助你弄清楚你在做什么-如果你需要任何帮助来构建这个查询,我建议你调查一下
this page.