twenty ten主题首页显示摘要的方法

twenty ten主题首页显示摘要的方法

twenty ten通过调用loop.php文件来实现首页的文章显示

将loop.php文件的
        第70行:
        <?php the_content(); ?>
       第109行:
       <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘twentyten’ ) ); ?>
        第137行:
      <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘twentyten’ ) ); ?>
       以上的内容全部修改为:
       <?php
        if (is_single() or is_page()) {
            the_content();
        } else {
            the_excerpt();
        }
       ?>
同时启用
wp-utf8-excerpt插件

然后在同一个文件夹下面找到functions.php文件。在298行处:
function twentyten_continue_reading_link() {
return ‘ <a href="’. get_permalink() . ‘">’ . __( ‘Continue reading <span>→</span>’, ‘twentyten’ ) . ‘</a>’;
}

替换成:
function twentyten_continue_reading_link() {
return ‘ <a href="’. get_permalink() . ‘">’ . __( ‘阅读全文 <span>→</span>’, ‘twentyten’ ) . ‘</a>’;
}

或者是,其他什么你喜欢的提示语。
将修改好的文件上传覆盖后,就可以了。如果没有效果,检查一下文章的摘要是不是没有写。如果想在首页摘要里面显示图片,则需要在写摘要的时候,在开头加下面这一句,内容自己根据实际情况填写。

wordpress中英文摘要插件wp-utf8-excerpt

以上就是twenty ten主题首页显示摘要的方法全文,更多:wordpress技巧

via:原文

仿豆瓣wordpress主题 wordpress死神主题下载   wordpress动漫主题下载

wordpress中英文摘要插件wp-utf8-excerpt

Tagged . Bookmark the permalink.

Leave a Reply