<?php
/*
Template Name: Ron\'s WordPress Answers Template
*/
include_once(\'header.php\');
$args = array(
\'posts_per_page\' => 5,
\'offset\' => 0,
\'category\' => \'\',//you have to use the category id # here not the name of the cat
\'orderby\' => \'post_date\',
\'order\' => \'DESC\',
\'post_type\' => \'post\',
\'post_status\' => \'publish\',
\'suppress_filters\' => true );
$posts = get_posts( $args );
global $post;
foreach( $posts as $post ){
setup_postdata($post);
?>
<div class="post">
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></p>
<div class="meta">
By <?php the_author() ?>
</div>
<div class="storycontent">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
}else{
}
?>
<?php the_content(); ?>
</div>
</div>
<?php
}
include_once(\'footer.php\'); ?>
\\u post\\u缩略图(“缩略图”);//缩略图(默认150px x 150px最大值)\\u post\\u缩略图(“中”);//中等分辨率(默认300px x 300px最大值)\\u post\\u缩略图(“大”);//大分辨率(默认640px x 640px最大值)\\u post\\u缩略图(“完整”);//全分辨率(上载的原始大小)
我喜欢这样使用ccs来确保图像显示“很好”。
.storycontent img{
max-width: 100%;
height: auto;
}