您需要使用自定义贴子,在那里创建类别,并在每个贴子中对齐缩略图。
<?php // query post type */*/
global $post;
$args = array(
\'post_type\' => \'YOUR-POST-TYPE-HERE\',
\'cat\' => $category,
\'suppress_filters\' => \'0\',
\'numberposts\' =>\'-1\',
\'orderby\' => \'title\',
\'order\' => \'asc\',
\'post_status\' => \'publish\' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post);
$meta = $custom_metabox_jurister->the_meta();?>
And check if post have thumnail:
<?php // Checks if there is a thumbnail and displays it
if ( has_post_thumbnail() ) {
$size = \'thumbnail\';
$attr = array(
\'class\' => \'post-logo\');
echo \'<div class="image">\';
echo the_post_thumbnail(\'large\', $attr);
echo \'</div>\';
}
else{
// Do nothing
}
?>
更改代码,以符合您的想法。
Not sure if I understood exactly what you wanted to do. But hope this helps.