zoukankan      html  css  js  c++  java
  • wputf8excerptwordpress 显示摘要

    Main features of the plugin:
    1. It supports multibyte language (such as Chinese). It will not produce gibberish as some other excerpt plugins do.
    2. The html tags in the original posts, i.e., the font styles, colors, hyperlinks, pictures and such are preserved in the excerpt.
    3. For better readability, it displays 300 characters for each post on the homepage and 150 characters for each post on archive pages.

    主要特点: 1,支持多字节语言(如中文),不会产生乱码。 2,摘要可保留文章中的格式标签,如字体、颜色、链接、图片等(需保留的标签可在后台设置)。 3,首页每篇文章显示300字,存档页面每篇文章显示150字(字数可设置)。

    Installation
    1. Unzip and upload the wp-utf8-excerpt directory to the /wp-content/plugins/ directory
    2. Activate the plugin through the 'Plugins' menu in WordPress
    3. In your theme directory, edit the index.php file by changing

      <?php the_content(); ?>
      

    to

        <?php
            if (is_single() or is_page()) {
                the_content();
            } else {
                the_excerpt();
            } 
        ?>
    

    安装: 1,解压到/wp-content/plugins/目录 2,在插件页面激活插件 3,修改主题的index.php文件,把

        <?php the_content(); ?>
    

    改成

        <?php
            if (is_single() or is_page()) {
                the_content();
            } else {
                the_excerpt();
            } 
        ?>
    

    注意:有些主题在the_content()中还有一些字,比如the_content(’Continue Reading »’),这种要把整句话换掉。有些主题用了其他文件来控制存档页面,如category.php、archive.php等,如有必要,请对这些文件也做修改。

  • 相关阅读:
    其实Unix很简单
    路由器硬件和操作系统软件关系之我见
    80后的我们
    虚拟机虚拟网卡作用
    [转]Cisco小失误,大麻烦
    DDWRT让我们的无线路由器用上Linux
    2011年全国大学生电子设计竞赛试题来自官网
    太网帧结构详解
    TCP/IP网络编程之四书五经
    四种以太网数据包详解
  • 原文地址:https://www.cnblogs.com/hsapphire/p/1686836.html
Copyright © 2011-2022 走看看