views

wp主题twentyfifteen首页布局的修改

1、把显示全文改成只显示摘要。在该主题目录下修改index.php第39行为“get_template_part( 'content-search', get_post_format() );”

2、获取第一张图片为缩略图。需要结合wpjam插件使用,在插件中开启该功能,然后找到该主题目录下面的content-search.php,在第22行插入:

<?php

if(wpjam_has_post_thumbnail()){?>

<div class="entry-thumb" align="center">
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php wpjam_post_thumbnail([600,600],$crop=1);?></a>
</div>
<?php } ?>

《wp主题twentyfifteen首页布局的修改》上有1条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

Captcha Code