我如何才能在WordPress中像这里一样显示帖子的缩略图和标题:http://themes.premiumpixels.com/?theme=artiste如何仅在WordPress中显示帖子的缩略图和标题?
p.S.我没有做广告,我只是发布了一个问题,因为我不知道如何做这样的事情。
我如何才能在WordPress中像这里一样显示帖子的缩略图和标题:http://themes.premiumpixels.com/?theme=artiste如何仅在WordPress中显示帖子的缩略图和标题?
p.S.我没有做广告,我只是发布了一个问题,因为我不知道如何做这样的事情。
//从你的循环只是删除the_content()或the_excerpt()调用
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!-- do stuff ... -->
if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
}
post_title();// to display the post title
<?php endwhile; ?>
<?php endif; ?>
你需要对图像做:
http://www.wpbeginner.com/wp-themes/how-to-add-post-thumbnails-in-wordpress/
而你需要做的为小文本:
在function.php中加入:
add_post_type_support('page', 'excerpt');
然后在模板中添加此您post_thumbnail下面的链接证明你:
<?php the_exceprt(); ?>
不认为是什么他问。 – 2012-02-05 01:21:51
没有他只是想显示帖子缩略图和标题...如果我没有错你所提供的sol会显示文本摘录形式的帖子(我认为这将是40个字符的默认) – tinyhook 2012-02-05 18:42:00
我可能是错误的,但根据那链接不只是一个标题,但一些额外的小信息连同它 – 2012-02-05 19:29:16