WordPress修改文章列表显示摘要
2014-01-29 02:50
459 查看
用WordPress 3.8开的个人博客longt.me,在主页,分类页,搜索页时均为全文,文章多了效果不太好,查了一下官方文档,修改为首页显示摘要,具体方法如下:
进入外观-〉编辑,选择content.php,将下面代码:
替换为:
进入外观-〉编辑,选择content.php,将下面代码:
<?php if ( is_search() ) : ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php endif; ?>
替换为:
<?php if ( is_single() ) : // Only display full content for Single page ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php else : ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php endif; ?>
相关文章推荐
- WordPress修改文章列表显示摘要
- 让wordpress博客首页、分类页 显示文章标题列表或摘要
- 让wordpress博客首页、分类页 显示文章标题列表或摘要
- ECSHOP修改文章列表显示文章内容提要
- 下面介绍四种WordPress 显示文章摘要方法:
- WordPress 主题制作技巧之四 [ 在首页或分类页显示文章摘要 ]
- dedecms后台每页文章条数如何修改(“文档列表”每一页显示的文档条数)
- 修改wordpress列表页默认显示文章的数量和排序方式
- WORDPRESS自定义文章列表显示
- 让WordPress文章自动截断显示摘要
- 修改WordPress文章索引列表的日期格式
- wordpress 首页文章显示摘要
- WordPress在文章列表中显示评论
- wordpress日志中的全部图片以缩略图的形式显示在文章摘要底部
- WordPress中修改固定链接导致无法显示文章内容的问题的解决办法
- Laravel大型项目系列教程(四)显示文章列表和用户修改文章
- Laravel大型项目系列教程(四)之显示文章列表和用户修改文章
- 博客首页及分类等处文章列表中显示文章的方式更改为文章摘要
- wordpress显示最新的一篇文章的缩略图和摘要
- 显示 wordpress 文章摘要函数the_excerpt