<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/zmingcx" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/zmingcx" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 13 Feb 2012 10:48:37 GMT</lastBuildDate><title>知更鸟</title><description>zmingcx.com</description><image><url>http://www.feedsky.com/feed/zmingcx/sc/gif</url><title>知更鸟</title><link>http://zmingcx.com</link></image><link>http://zmingcx.com</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Tue, 14 Feb 2012 00:14:06 GMT</pubDate><item><title>关于HotNews主题很“卡”的感觉</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/605345967/5172474/1/item.html</link><content:encoded>&lt;p&gt;很多使用HotNews主题的朋友，都有一个感觉：打开博客后向下滑动页面，会很“卡”，普遍会认为是主题功能复杂或者是自己的主机空间不给力造成的，其实与此无关。&lt;/p&gt;
&lt;p&gt;下面简单说一下造成此问题的原因及解决办法：&lt;/p&gt;
&lt;p&gt;HotNews主题集成了图片延迟加载功能（参见：&lt;a title=&quot;jQuery实现图片延迟加载&quot; href=&quot;http://zmingcx.com/jquery-lazy-to-achieve-picture.html&quot; target=&quot;_blank&quot;&gt;jQuery实现图片延迟加载&lt;/a&gt;），只有当页面滚动到图片的位置才会加载它们。本来是为了提高页面加载速度，不过事与愿违，由于大多数人不喜欢单独制作缩略图，直接把文章中尺寸较大的图片作为缩略图使用，同时加载10几张2、3百K的图片，打开速度可想而知，直接导致加载过程序中浏览器会出现“卡”的现象，原因找到了，解决办法：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;保留图片延迟加载功能，单独制作尺寸较小的缩略图，会提高加载速度。&lt;/li&gt;
&lt;li&gt;或者干脆去掉这个图片延迟加载功能：&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;打开所有以header开头的模版文件，共有6个，找到：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;!-- 图片延迟加载 --&amp;gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;include&lt;/span&gt;&lt;span&gt;('includes/lazyload.php'); ?&amp;gt;  &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;删除。&lt;/p&gt;
&lt;p&gt;之后，刷新博客首页并滚动浏览器，看看原来“卡”的感觉是不是没了。&lt;/p&gt;
&lt;p&gt;再升级主题时会考虑添加选项，自主选择是否开启图片延迟加载功能。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/605345967/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/605345967/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/feeling-of-the-card-on-the-the-hotnews-theme-to-open-the-page.html/feed</wfw:commentRss><slash:comments>13</slash:comments><description>很多使用HotNews主题的朋友，都有一个感觉：打开博客后向下滑动页面，会很“卡”，普遍会认为是主题功能复杂或者是自己的主机空间不给力造成的，其实与此无关。 下面简单说一下造成此问题的原因及解决办法： HotNews主题集成了图片延迟加载功能（参见：jQuery实现图片延迟加载），只有当页面滚动到图片的位置才会加载它们。本来是为了提高页面加载速度，不过事与愿违，由于大多数人不喜欢单独制作缩略图，直接把文章中尺寸较大的图片作为缩略图使用，同时加载10几张2、3百K的图片，打开速度可想而知，直接导致加载过程序中浏览器会出现“卡”的现象，原因找到了，解决办法： 保留图片延迟加载功能，单独制作尺寸较小的缩略图，会提高加载速度。 或者干脆去掉这个图片延迟加载功能： 打开所有以header开头的模版文件，共有6个，找到： &amp;#60;!-- 图片延迟加载 --&amp;#62;    &amp;#60;?php include('includes/lazyload.php'); ?&amp;#62;   删除。 之后，刷新博客首页并滚动浏览器，看看原来“卡”的感觉是不是没了。 再升级主题时会考虑添加选项，自主选择是否开启图片延迟加载功能。&lt;img src=&quot;http://www1.feedsky.com/t1/605345967/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/605345967/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>HotNews主题</category><pubDate>Mon, 13 Feb 2012 18:48:37 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/feeling-of-the-card-on-the-the-hotnews-theme-to-open-the-page.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4871</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/feeling-of-the-card-on-the-the-hotnews-theme-to-open-the-page.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/605345967/5172474</fs:itemid></item><item><title>单篇文章嵌入不同的RSS或Atom feed地址</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/604697990/5172474/1/item.html</link><content:encoded>&lt;p&gt;该功能主要用于转载文章时，为了尊重原文作者，也为了方便自己和其他阅读者及时掌握原文作者最新文章动态而折腾的一个小功能。&lt;/p&gt;
&lt;p&gt;WordPress可以通过使用下面代码，在任意位置调用不同的RSS或Atom feed地址条目，代码来自：&lt;a title=&quot;Function Reference/wp rss&quot; href=&quot;http://codex.wordpress.org/Function_Reference/wp_rss&quot; target=&quot;_blank&quot;&gt;官方Codex&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;?php   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;include_once&lt;/span&gt;&lt;span&gt;(ABSPATH . WPINC . '/rss.php');   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;wp_rss(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$uri&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$num&lt;/span&gt;&lt;span&gt;);   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;?&amp;gt;   &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;在此基础上，利用Wordpress自定义栏目功能，改进后的代码：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; ( get_post_meta(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$post&lt;/span&gt;&lt;span&gt;-&amp;gt;ID, 'feed', true) ) : ?&amp;gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;lt;p &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;feeds&quot;&lt;/span&gt;&lt;span&gt; style=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;font-weight:bold;&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;本文作者最新文章&amp;lt;/p&amp;gt;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;include_once&lt;/span&gt;&lt;span&gt;(ABSPATH.WPINC.'/rss.php');?&amp;gt;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$feed&lt;/span&gt;&lt;span&gt; = get_post_meta(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$post&lt;/span&gt;&lt;span&gt;-&amp;gt;ID, 'feed', true); ?&amp;gt;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;lt;?php wp_rss(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$feed&lt;/span&gt;&lt;span&gt;, 5); ?&amp;gt;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;endif&lt;/span&gt;&lt;span&gt;; ?&amp;gt;  &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;将该代码加到主题文章页面模版single.php的适当位置，一般放到：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;?php the_content('Read more...'); ?&amp;gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;的下面，也就是文章末尾。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;使用方法：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;编辑文章时，在自定义栏目名称中输入：feed，值：为调用的RSS或Atom feed链接地址。&lt;/p&gt;
&lt;p&gt;默认显示5篇RSS地址最新文章，可以自行修改其中的数字，不添加自定义栏目“feed”则不显示该内容。&lt;/p&gt;
&lt;p&gt;具体效果演示如下：调用的Wordpress官网博客FEED&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/604697990/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/604697990/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/the-embedded-in-the-rss-or-atom-feed-address.html/feed</wfw:commentRss><slash:comments>21</slash:comments><description>该功能主要用于转载文章时，为了尊重原文作者，也为了方便自己和其他阅读者及时掌握原文作者最新文章动态而折腾的一个小功能。Wordpress可以通过使用下面代码，在任意位置调用不同的RSS或Atom feed地址，代码来自：官方Codex.
使用方法：编辑文章时，在自定义栏目名称中输入：feed，值：为调用的RSS或Atom feed链接地址。默认显示5篇最新文章，可以自行修改其中的数字，不添加自定义栏目“feed”则不显示该内容。&lt;img src=&quot;http://www1.feedsky.com/t1/604697990/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/604697990/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Wordpress</category><category>RSS</category><pubDate>Sat, 11 Feb 2012 12:33:28 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/the-embedded-in-the-rss-or-atom-feed-address.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4870</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/the-embedded-in-the-rss-or-atom-feed-address.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/604697990/5172474</fs:itemid></item><item><title>jQuery实现侧边栏随窗口滚动</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/603237366/5172474/1/item.html</link><content:encoded>&lt;p&gt;近日帮人作主题要求弄个侧边栏某个模块随窗口一起滚动，可能其他童鞋也想给主题加上这个小功能，贴出来，供大家参考。&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #800000;&quot;&gt;方法一：&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;很简单，前提是你的主题必须已加载了jQuery。&lt;/p&gt;
&lt;p&gt;把下面代码加到主题头部header.php模版中即可：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;script type=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;$(&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;() {&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;    &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$sidebar&lt;/span&gt;&lt;span&gt;   = $(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;#sidebar&quot;&lt;/span&gt;&lt;span&gt;),   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$window&lt;/span&gt;&lt;span&gt;    = $(window),   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        offset     = &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$sidebar&lt;/span&gt;&lt;span&gt;.offset(),   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        topPadding = 15;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$window&lt;/span&gt;&lt;span&gt;.scroll(&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;() {   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$window&lt;/span&gt;&lt;span&gt;.scrollTop() &amp;gt; offset.top) {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$sidebar&lt;/span&gt;&lt;span&gt;.stop().animate({   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;                marginTop: &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$window&lt;/span&gt;&lt;span&gt;.scrollTop() - offset.top + topPadding   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            });   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        } &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt; {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$sidebar&lt;/span&gt;&lt;span&gt;.stop().animate({   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;                marginTop: 0   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            });   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        }   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    });   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;});   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;lt;/script&amp;gt;  &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;可根据不同的主题模版，自行修改一下其中的DIV标签&lt;span style=&quot;color: #800000;&quot;&gt;#sidebar&lt;/span&gt;名称。此方法兼容所有浏览器。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://css-tricks.com/examples/ScrollingSidebar/&quot; target=&quot;_blank&quot;&gt;演示效果&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HotNews主题也可使用该功能，默认是整个侧边栏随窗口滚动，受主题布局功能限制，单独滚动某个模块效果不是很理想。&lt;/p&gt;
&lt;p&gt;参考自：&lt;a href=&quot;http://css-tricks.com/scrollfollow-sidebar/&quot; target=&quot;_blank&quot;&gt;http://css-tricks.com/scrollfollow-sidebar/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #800000;&quot;&gt;方法二：&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;本人未试过，可以自行参阅：&lt;a href=&quot;http://www.zhangxinxu.com/wordpress/?p=1242&quot; target=&quot;_blank&quot;&gt;js页面滚动时层智能浮动定位实现&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/603237366/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/603237366/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/jquery-the-the-the-the-the-the-sidebar-scroll-with-the-window.html/feed</wfw:commentRss><slash:comments>36</slash:comments><description>近日帮人作主题要求弄个侧边栏某个模块随窗口一起滚动，可能其它童鞋也想给主题加上这个小功能，贴出来，供大家参考。

方法很简单，前提是你的主题必须已加载了jQuery。把下面代码加到主题头部header.php模版中即可，根据不同的主题模版，自行修改一下其中的DIV标签#sidebar名称。

HotNews主题也可使用该功能，默认是整个侧边栏随窗口滚动，受主题布局功能限制，单独滚动某个模块效果不是很理想。&lt;img src=&quot;http://www1.feedsky.com/t1/603237366/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/603237366/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>JQuery</category><category>Wordpress</category><pubDate>Tue, 07 Feb 2012 12:09:32 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/jquery-the-the-the-the-the-the-sidebar-scroll-with-the-window.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4869</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/jquery-the-the-the-the-the-the-sidebar-scroll-with-the-window.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/603237366/5172474</fs:itemid></item><item><title>WordPress博客评论可见实现方法</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877061/5172474/1/item.html</link><content:encoded>&lt;p&gt;之前帮别人测试评论可见功能，并在上一篇文章&lt;a title=&quot;为WordPress添加文章字数统计&quot; href=&quot;http://zmingcx.com/statistics-for-wordpress-article-length.html&quot; target=&quot;_blank&quot;&gt;《为WordPress添加文章字数统计》&lt;/a&gt;中试用一下，感觉还是很不错的实用功能，可以增加一下访客的评论积极性，也可能会增加一大堆无用的垃圾留言，在论坛上很常见的功能，用多了可能让人产生厌恶。不过很多童鞋对此很感兴趣，所以把实现方法贴过来。&lt;/p&gt;
&lt;p&gt;首先推荐一款实现该功能的插件：&lt;a href=&quot;http://wordpress.org/extend/plugins/easy2hide/&quot; target=&quot;_blank&quot;&gt;easy2hide&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;使用方法，启用插件后，在编辑文章时加入：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;!--easy2hide start{reply_to_this=true}--&amp;gt;一些隐藏内容&amp;lt;!--easy2hide &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;end&lt;/span&gt;&lt;span&gt;--&amp;gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;下面再说说不用插件的实现方法，该方法原始代码应该是出自：&lt;a href=&quot;http://messense.me/wp-shortcode-of-reply-to-read.html&quot; target=&quot;_blank&quot;&gt;乱了感觉&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;原始代码有个缺点即使是博主或者站长，也需要评论之后才能够看到隐藏的内容，所以又有人对该代码进行了改进。代码具体出处未知，有人认领请告知。&lt;/p&gt;
&lt;p&gt;把下面代码加到主题functions.php文件中：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; reply_to_read(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$atts&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;=null) {   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        extract(shortcode_atts(&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;notice&quot;&lt;/span&gt;&lt;span&gt; =&amp;gt; '&amp;lt;p &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;reply-to-read&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;温馨提示: 此处内容需要&amp;lt;a href=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;#respond&quot;&lt;/span&gt;&lt;span&gt; title=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;评论本文&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;评论本文&amp;lt;/a&amp;gt;后才能查看.&amp;lt;/p&amp;gt;'), &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$atts&lt;/span&gt;&lt;span&gt;));   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$email&lt;/span&gt;&lt;span&gt; = null;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$user_ID&lt;/span&gt;&lt;span&gt; = (int) wp_get_current_user()-&amp;gt;ID;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$user_ID&lt;/span&gt;&lt;span&gt; &amp;gt; 0) {   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$email&lt;/span&gt;&lt;span&gt; = get_userdata(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$user_ID&lt;/span&gt;&lt;span&gt;)-&amp;gt;user_email;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;//对博主直接显示内容 &lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$admin_email&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;xxx@aaa.com&quot;&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;//博主Email &lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$email&lt;/span&gt;&lt;span&gt; == &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$admin_email&lt;/span&gt;&lt;span&gt;) {   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;                &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            }   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        } &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (isset(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span&gt;['comment_author_email_' . COOKIEHASH])) {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$email&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;str_replace&lt;/span&gt;&lt;span&gt;('%40', '@', &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span&gt;['comment_author_email_' . COOKIEHASH]);   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        } &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt; {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$notice&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        }   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;empty&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$email&lt;/span&gt;&lt;span&gt;)) {   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$notice&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        }   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;global&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$wpdb&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$post_id&lt;/span&gt;&lt;span&gt; = get_the_ID();   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$query&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;SELECT `comment_ID` FROM {$wpdb-&amp;gt;comments} WHERE `comment_post_ID`={$post_id} and `comment_approved`='1' and `comment_author_email`='{$email}' LIMIT 1&quot;&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$wpdb&lt;/span&gt;&lt;span&gt;-&amp;gt;get_results(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$query&lt;/span&gt;&lt;span&gt;)) {   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; do_shortcode(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;);   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        } &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt; {   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$notice&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        }   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;    }   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;    add_shortcode('reply', 'reply_to_read');  &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;自行修改其中的博主Email地址。&lt;/p&gt;
&lt;p&gt;使用方法，编辑文章时添加：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;[@reply]评论可见的内容[@/reply]  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;或者&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;[@reply notice=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;自定义的提示信息&quot;&lt;/span&gt;&lt;span&gt;]评论可见的内容[@/reply]  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;提示：使用时去掉其中的@&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;效果演示：&lt;a title=&quot;为WordPress添加文章字数统计&quot; href=&quot;http://zmingcx.com/statistics-for-wordpress-article-length.html&quot; target=&quot;_blank&quot;&gt;为WordPress添加文章字数统计&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/602877061/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877061/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/wordpress-blog-comments-can-be-seen.html/feed</wfw:commentRss><slash:comments>28</slash:comments><description>之前帮别人测试评论可见功能，并在上一篇文章《为WordPress添加文章字数统计》中试用一下，感觉还是很不错的实用功能，可以增加一下访客的评论积极性，也可能会增加一大堆无用的垃圾留言，在论坛上很常见的功能，用多了可能让人产生厌恶。不过很多童鞋对此很感兴趣，所以把实现方法贴过来。 首先推荐一款实现该功能的插件：easy2hide 使用方法，启用插件后，在编辑文章时加入： &amp;#60;!--easy2hide start{reply_to_this=true}--&amp;#62;一些隐藏内容&amp;#60;!--easy2hide end--&amp;#62;   下面再说说不用插件的实现方法，该方法原始代码应该是出自：乱了感觉 原始代码有个缺点即使是博主或者站长，也需要评论之后才能够看到隐藏的内容，所以又有人对该代码进行了改进。代码具体出处未知，有人认领请告知。 把下面代码加到主题functions.php文件中： function reply_to_read($atts, $content=null) {            extract(shortcode_atts(array(&quot;notice&quot; =&amp;#62; '&amp;#60;p class=&quot;reply-to-read&quot;&amp;#62;温馨提示: 此处内容需要&amp;#60;a href=&quot;#respond&quot; title=&quot;评论本文&quot;&amp;#62;评论本文&amp;#60;/a&amp;#62;后才能查看.&amp;#60;/p&amp;#62;'), $atts));            $email = null;            $user_ID = (int) wp_get_current_user()-&amp;#62;ID;            if ($user_ID &amp;#62; 0) {                $email = get_userdata($user_ID)-&amp;#62;user_email;                //对博主直接显示内容                $admin_email = &quot;xxx@aaa.com&quot;; //博主Email                if ($email == $admin_email) {                    return $content;                }            } else if (isset($_COOKIE['comment_author_email_' . COOKIEHASH])) {                $email = str_replace('%40', '@', $_COOKIE['comment_author_email_' . COOKIEHASH]);            } else {                return $notice;            }            if (empty($email)) {                return $notice;            }            global $wpdb;            $post_id = get_the_ID();            $query = &quot;SELECT `comment_ID` FROM {$wpdb-&amp;#62;comments} WHERE `comment_post_ID`={$post_id} and `comment_approved`='1' and `comment_author_email`='{$email}' LIMIT 1&quot;;            if ($wpdb-&amp;#62;get_results($query)) {                return do_shortcode($content);    [...]&lt;img src=&quot;http://www1.feedsky.com/t1/602877061/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877061/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>评论可见</category><category>Wordpress</category><pubDate>Mon, 06 Feb 2012 21:29:28 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/wordpress-blog-comments-can-be-seen.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4868</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/wordpress-blog-comments-can-be-seen.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/602877061/5172474</fs:itemid></item><item><title>为WordPress添加文章字数统计</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877062/5172474/1/item.html</link><content:encoded>&lt;p&gt;WordPress在后台编辑日志时编辑框左下角有一个字数统计，不过只显示在后台，能不能在前台也加上文章字数统计功能呢？研究了一下程序源文件，发现中文版WP后台的字数统计功能，是通过wp-content\languages目录的zh_CN-word-count.js实现的，就是不知道如何调用。网上搜了一下，找到两篇老外给出的代码：&lt;/p&gt;
&lt;p&gt;一、把下面代码加到主题的functions.php文件中：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; count_words(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$str&lt;/span&gt;&lt;span&gt;){   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;    &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$words&lt;/span&gt;&lt;span&gt; = 0;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$str&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;eregi_replace&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot; +&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$str&lt;/span&gt;&lt;span&gt;);   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;    &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$array&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;explode&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$str&lt;/span&gt;&lt;span&gt;);   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;for&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$i&lt;/span&gt;&lt;span&gt;=0;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$i&lt;/span&gt;&lt;span&gt; &amp;lt; &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;count&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$array&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$i&lt;/span&gt;&lt;span&gt;++)   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;     {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;eregi&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;[0-9A-Za-zÀ-ÖØ-öø-ÿ]&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$array&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$i&lt;/span&gt;&lt;span&gt;]))   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;            &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$words&lt;/span&gt;&lt;span&gt;++;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    }   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;    &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$words&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;然后在single.php中希望显示字数统计的位置加上：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;Word &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;count&lt;/span&gt;&lt;span&gt;: &amp;lt;?php &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span&gt; count_words(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$post&lt;/span&gt;&lt;span&gt;-&amp;gt;post_content); ?&amp;gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://www.wprecipes.com/laura-asked-how-to-get-words-count-of-your-post&quot; target=&quot;_blank&quot;&gt;原文&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;二、还是将下面代码加到functions.php文件中，此方法与上面不同的是，还加上了一个估算的阅读时间：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;comment&quot;&gt;// Custom functions &lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;comment&quot;&gt;// START : Show word count &lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; show_post_word_count(){   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;ob_start();   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;the_content();   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt; = ob_get_clean();   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; sizeof(&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;explode&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;));   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;}   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;comment&quot;&gt;// END : Show word count &lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;comment&quot;&gt;// START : Estimated reading time &lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (!function_exists('est_read_time')):   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; est_read_time( &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$return&lt;/span&gt;&lt;span&gt; = false) {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;vars&quot;&gt;$wordcount&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;round&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;str_word_count&lt;/span&gt;&lt;span&gt;(get_the_content()), -2);   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;vars&quot;&gt;$minutes_fast&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;ceil&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$wordcount&lt;/span&gt;&lt;span&gt; / 250);   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;vars&quot;&gt;$minutes_slow&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;ceil&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$wordcount&lt;/span&gt;&lt;span&gt; / 150);   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$wordcount&lt;/span&gt;&lt;span&gt; &amp;lt;= 150) {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;vars&quot;&gt;$output&lt;/span&gt;&lt;span&gt; = __(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;&amp;lt; 1 minute&quot;&lt;/span&gt;&lt;span&gt;);   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;} &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt; {   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;vars&quot;&gt;$output&lt;/span&gt;&lt;span&gt; = sprintf(__(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;%s - %s minutes&quot;&lt;/span&gt;&lt;span&gt;), &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$minutes_fast&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$minutes_slow&lt;/span&gt;&lt;span&gt;);   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;}   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$output&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;}   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;endif&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (!function_exists('est_the_content')):   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; est_the_content( &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$orig&lt;/span&gt;&lt;span&gt; ) {   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;comment&quot;&gt;// Prepend the reading time to the post content &lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; est_read_time(true) . &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;\n\n&quot;&lt;/span&gt;&lt;span&gt; . &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$orig&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;}   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;endif&lt;/span&gt;&lt;span&gt;;   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;comment&quot;&gt;// END : Estimated reading time&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;同样在single.php中希望显示字数统计的位置加上：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;The following &amp;lt;?php &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span&gt; show_post_word_count(); ?&amp;gt; words should take about &amp;lt;?php &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span&gt; est_read_time(); ?&amp;gt; to read.  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://www.welcomebrand.co.uk/thoughts/wordpress-reading-time-and-word-count/&quot; target=&quot;_blank&quot;&gt;原文&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;可惜上述两种方法对汉字统计无效，只适合纯英文站点，网上也没发现与中文博客字数统计相关的文章，没办法还是自己折腾一个吧。&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: #000000;&quot;&gt;WordPress中文博客文章字数统计代码&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;p class=&quot;reply-to-read&quot; style=&quot;color:#ff0000;width:350px;margin:20px auto 20px;border:1px solid #ccc;&quot;&gt;提示：以下内容需要您&lt;a href=&quot;#respond&quot; title=&quot;添加留言&quot;&gt; &lt;b&gt;添加留言&lt;/b&gt; &lt;/a&gt;并刷新后方可查看！&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;效果看这篇文章标题下面信息栏&lt;/p&gt;
&lt;p&gt;这个评论可见功能参见：&lt;a title=&quot;详细阅读 WordPress博客评论可见实现方法&quot; href=&quot;../wordpress-blog-comments-can-be-seen.html&quot; rel=&quot;bookmark&quot;&gt;WordPress博客评论可见实现方法&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/602877062/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877062/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/statistics-for-wordpress-article-length.html/feed</wfw:commentRss><slash:comments>65</slash:comments><description>　　Wordpress在后台编辑日志时编辑框左下角有一个字数统计，不过只显示在后台，能不能在前台也加上文章字数统计功能呢？研究了一下程序源文件，发现中文版WP后台的字数统计功能，是通过wp-content\languages目录的zh_CN-word-count.js实现的，就是不知道如何调用，网上搜了一下，找到两篇老外给出的代码。
　　可惜上述两种方法对汉字统计无效，只适合纯英文站点，网上也没发现与中文博客字数统计相关的文章，没办法还是自己写一个吧，添加方法与上述相同.......&lt;img src=&quot;http://www1.feedsky.com/t1/602877062/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877062/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Wordpress</category><category>字数统计</category><pubDate>Mon, 06 Feb 2012 07:56:15 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/statistics-for-wordpress-article-length.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4867</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/statistics-for-wordpress-article-length.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/602877062/5172474</fs:itemid></item><item><title>显示当前在线浏览人数</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877063/5172474/1/item.html</link><content:encoded>&lt;p&gt;随时了解一下当前有多少访客在浏览自己的站点，是不是也很有意思，Wordpress有类似的插件，比如：WP OnlineCounter、WP-User Online等，不过这些插件都会向数据库中写入数据，并频繁读取数据库，只为了实现这个蛋疼的小功能，不是很划算。&lt;/p&gt;
&lt;p&gt;其实用下面一段代码就可轻松实现当前在线人数功能，此项免费服务来自www.whoisonline.net，不占用自己的数据库资源：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;当前有 &amp;lt;script type=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span&gt; src=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;http://www.whoisonline.net/?action=tracker&amp;amp;siteurl=http://zmingcx.tk/&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;a href=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;http://www.whoisonline.net/?action=showstats&amp;amp;url=http://zmingcx.tk/&quot;&lt;/span&gt;&lt;span&gt;&amp;gt; 位浏览者&amp;lt;/a&amp;gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;将上面代码中的&lt;span style=&quot;color: #800000;&quot;&gt;&quot;http://zmingcx.tk/&quot;&lt;/span&gt;改为自己网站的链接，加到模版适当的位置。而且可通过点击文字，查看访客具体浏览的页面。&lt;/p&gt;
&lt;p&gt;HotNews主题可以打开HotNewspro\includes目录的time.php模版，加到：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;include&lt;/span&gt;&lt;span&gt;('counter.php'); ?&amp;gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;下面，效果可以查看我博客顶部问候语。&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;注：请使用Notepad++、EmEditor、EditPlus文本编辑工具编辑修改中文主题模板，中文模版编码格式为：UTF-8 无BOM，保存时注意编码格式，否则会出现不可预知的问题。&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/602877063/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877063/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/displays-the-current-number-of-online.html/feed</wfw:commentRss><slash:comments>22</slash:comments><description>　　随时了解一下当前有多少访客在浏览自己的站点，是不是也很有意思，Wordpress有类似的插件，比如：WP OnlineCounter、WP-User Online等，不过这些插件都会向数据库中写入数据，并频繁读取数据库，为了实现这个蛋疼的小功能，不是很划算。

　　其实用下面一段代码就可轻松实现当前在线人数功能，此项免费服务来自www.whoisonline.net，不占用自己的数据库资源，将上面代码加到模版适当的位置，而且可通过点击文字，查看访客具体浏览的页面。&lt;img src=&quot;http://www1.feedsky.com/t1/602877063/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877063/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>Wordpress</category><pubDate>Sat, 04 Feb 2012 17:20:19 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/displays-the-current-number-of-online.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4864</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/displays-the-current-number-of-online.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/602877063/5172474</fs:itemid></item><item><title>揪出哪些插件在拖慢你的网站</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877064/5172474/1/item.html</link><content:encoded>&lt;p&gt;WordPress众多插件让人眼花缭乱，启用十个、二十个插件也是件很平常的事，你是否想知道到底这些插件对你的网站速度有多大的影响吗？&lt;/p&gt;
&lt;p&gt;WordPress插件：&lt;a title=&quot;P3 (Plugin Performance Profiler)&quot; href=&quot;http://wordpress.org/extend/plugins/p3-profiler/&quot; target=&quot;_blank&quot;&gt;P3 (Plugin Performance Profiler)&lt;/a&gt;，可以让你详细了解哪些插件占用资源最多，权衡利弊，有选择性地启用插件。&lt;/p&gt;
&lt;p&gt;启用&lt;a title=&quot;P3 (Plugin Performance Profiler)&quot; href=&quot;http://wordpress.org/extend/plugins/p3-profiler/&quot; target=&quot;_blank&quot;&gt;P3 (Plugin Performance Profiler)&lt;/a&gt;插件后，在&quot;工具&quot;面板中打开“P3 Profiler”，进入插件检测扫描页面，点击“start scan”按钮，开始扫描，稍等片刻，就会出现最终的检测结果，如图：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://i.imgur.com/SQJeE.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://i.imgur.com/SQJeE.jpg&quot; alt=&quot;&quot; width=&quot;675&quot; height=&quot;202&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;下面是所安装各插件详细的测试结果：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://i.imgur.com/RYI7b.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://i.imgur.com/RYI7b.jpg&quot; alt=&quot;&quot; width=&quot;661&quot; height=&quot;319&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://i.imgur.com/RleEJ.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://i.imgur.com/RleEJ.jpg&quot; alt=&quot;&quot; width=&quot;656&quot; height=&quot;317&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;插件&lt;span&gt;只能运行在Firefox、Chrome、 Opera、 Safari、IE9中，不支持IE8或更低版本。&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/602877064/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877064/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/ferret-out-which-the-plug-in-slow-down-your-site.html/feed</wfw:commentRss><slash:comments>16</slash:comments><description>WordPress众多插件让人眼花缭乱，启用十个、二十个插件也是件很平常的事，你是否想知道到底这些插件对你的网站速度有多大的影响吗？ WordPress插件：P3 (Plugin Performance Profiler)，可以让你详细了解哪些插件占用资源最多，权衡利弊，有选择性地启用插件。 启用P3 (Plugin Performance Profiler)插件后，在&quot;工具&quot;面板中打开“P3 Profiler”，进入插件检测扫描页面，点击“start scan”按钮，开始扫描，稍等片刻，就会出现最终的检测结果，如图： 下面是所安装各插件详细的测试结果： 插件只能运行在Firefox、Chrome、 Opera、 Safari、IE9中，不支持IE8或更低版本。 &amp;#160;&lt;img src=&quot;http://www1.feedsky.com/t1/602877064/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877064/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>网站速度</category><category>P3 (Plugin Performance Profiler)</category><category>plugins</category><category>Wordpress</category><pubDate>Sat, 04 Feb 2012 05:53:12 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/ferret-out-which-the-plug-in-slow-down-your-site.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4860</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/ferret-out-which-the-plug-in-slow-down-your-site.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/602877064/5172474</fs:itemid></item><item><title>Hotnews Pro主题使用须知</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877065/5172474/1/item.html</link><content:encoded>&lt;p&gt;此文写给懒得看使用说明，偏偏喜欢不耻下问的童鞋！这些问题不知反反复复有多少人问过了，实在是不想回复了，划拉一块，怕大家眼神不好，我再把字弄大点，呵呵&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-large; color: #ff0000;&quot;&gt;安装主题前请禁用所有插件&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #ff6600; font-size: large;&quot;&gt;特别是一些静态化缓存插件&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size: xx-large; color: #ff0000;&quot;&gt;设置分类ID无效&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: large; color: #808000;&quot;&gt;如果想设置CMS首页分类ID，每个分类至少应该不低于5、6篇文章，空站点就不要在那瞎忙活了，把文章凑齐了再说吧。&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;另外，主题不支持一篇文章属于多个分类。&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: #800000;&quot;&gt;下载安装&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;不要直接上传下载的压缩包，解压后上传里面的HotNewspro.zip，否则会提示样式表丢失&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: xx-large; color: #339966;&quot;&gt;&lt;strong&gt;启用主题后布局错位&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;这个问题是问的最多的，主题使用说明中写的清清楚楚：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;使用本主题先移除所有WP自带的小工具，或者给小工具加上标题，不然启用主题后布局会错位。&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;偏偏没人爱看，却很喜欢不耻下问。&lt;/p&gt;
&lt;p&gt;另外一些刚接触WP的童鞋，可能会说我没加小工具啊！新建的博客、刚安装的WP程序，会自动把搜索小工具加到侧边，而且默认是无标题的，所以大多数新博客安装Hotnews Pro主题后，都会有布局错乱的情况。如图：&lt;br /&gt;
&lt;a href=&quot;http://i.imgur.com/pvJeu.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://i.imgur.com/pvJeu.jpg&quot; alt=&quot;&quot; width=&quot;495&quot; height=&quot;334&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: #800000;&quot;&gt;&lt;span style=&quot;font-size: x-large; color: #ff6600;&quot;&gt;页脚导航及友情链接错位&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这也是问的较多的，同样使用说明中写的一清二白：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;主题顶部及页脚各有一个导航菜单，必须使用WP的“菜单”功能。顶部支持多级下拉菜单，&lt;span style=&quot;color: #ff0000;&quot;&gt;底部不支持多级菜单，否则会造成错位。&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;分别给顶部及页脚导航添加不同的导航菜单，顶部支持多级，页脚不能有二级下拉菜单。&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #ff6600; font-size: x-large;&quot;&gt;启用主题后必须到WP后台---外观----主题设置中，点一次“保存设置”&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #0000ff; font-size: xx-large;&quot;&gt;&lt;strong&gt;关于自定义栏目&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;HotNews主题部分功能需要通过添加自定义栏目来实现，比如指定显示缩略图、调用指定的文章等。但很多刚接触WP的童鞋在后台找了半天，也不知自定义栏目在哪，默认情况下自定义栏目选项会在文章编辑框下面，如图：&lt;br /&gt;
&lt;a href=&quot;http://photo.staticsdo.com/a1/184/195/67/91650-772704496-8.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://photo.staticsdo.com/a1/184/195/67/91650-772704496-8.jpg&quot; alt=&quot;&quot; width=&quot;607&quot; height=&quot;286&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;如果没有，可以打开右上角的“显示选项”，勾选“自定义栏目”即可，如图：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://photo.staticsdo.com/a1/8/178/1/91651-772704496-8.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://photo.staticsdo.com/a1/8/178/1/91651-772704496-8.jpg&quot; alt=&quot;&quot; width=&quot;696&quot; height=&quot;218&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: #800000;&quot;&gt;关于Post Views插件设置&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;虽然不一定非得安装Post Views统计插件，但不安装该插件会造成视频及相册模版竖排的日志信息缺失一项，视觉上不是很美观。&lt;br /&gt;
Post Views插件设置，最上面的三项选择如图：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://photo.staticsdo.com/a1/56/181/0/91627-772704496-8.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://photo.staticsdo.com/a1/56/181/0/91627-772704496-8.jpg&quot; alt=&quot;&quot; width=&quot;643&quot; height=&quot;236&quot; /&gt;&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: right;&quot;&gt;&lt;span style=&quot;color: #339966; font-size: xx-large;&quot;&gt;&lt;strong&gt;用什么工具修改主题模版文件&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;按教程修改模版时，请在后台主题编辑功能中修改，或者使用Notepad++文本编辑软件，决不能用系统自带的记事本，否则可能会造成错位或乱码。&lt;/p&gt;
&lt;p&gt;还有些什么问题想到了再加....&lt;/p&gt;
&lt;p&gt;另外，还可以参考此篇文章：&lt;a href=&quot;http://zmingcx.com/hotnewspro24-problem-summary.html&quot; target=&quot;_blank&quot;&gt;http://zmingcx.com/hotnewspro24-problem-summary.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/602877065/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877065/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/some-scattered-new-the-the-notes-written-with-the-the-the-wp.html/feed</wfw:commentRss><slash:comments>46</slash:comments><description>此文写给懒得看使用说明，偏偏喜欢不耻下问的童鞋！这些问题不知反反复复有多少人问过了，实在是不想回复了，划拉一块，怕大家眼神不好，我再把字弄大点，呵呵 安装主题前请禁用所有插件 特别是一些静态化缓存插件 设置分类ID无效 如果想设置CMS首页分类ID，每个分类至少应该不低于5、6篇文章，空站点就不要在那瞎忙活了，把文章凑齐了再说吧。 另外，主题不支持一篇文章属于多个分类。 下载安装 不要直接上传下载的压缩包，解压后上传里面的HotNewspro.zip，否则会提示样式表丢失 启用主题后布局错位 这个问题是问的最多的，主题使用说明中写的清清楚楚： 使用本主题先移除所有WP自带的小工具，或者给小工具加上标题，不然启用主题后布局会错位。 偏偏没人爱看，却很喜欢不耻下问。 另外一些刚接触WP的童鞋，可能会说我没加小工具啊！新建的博客、刚安装的WP程序，会自动把搜索小工具加到侧边，而且默认是无标题的，所以大多数新博客安装Hotnews Pro主题后，都会有布局错乱的情况。如图： 页脚导航及友情链接错位 这也是问的较多的，同样使用说明中写的一清二白： 主题顶部及页脚各有一个导航菜单，必须使用WP的“菜单”功能。顶部支持多级下拉菜单，底部不支持多级菜单，否则会造成错位。 分别给顶部及页脚导航添加不同的导航菜单，顶部支持多级，页脚不能有二级下拉菜单。 启用主题后必须到WP后台---外观----主题设置中，点一次“保存设置” 关于自定义栏目 HotNews主题部分功能需要通过添加自定义栏目来实现，比如指定显示缩略图、调用指定的文章等。但很多刚接触WP的童鞋在后台找了半天，也不知自定义栏目在哪，默认情况下自定义栏目选项会在文章编辑框下面，如图： 如果没有，可以打开右上角的“显示选项”，勾选“自定义栏目”即可，如图： 关于Post Views插件设置 虽然不一定非得安装Post Views统计插件，但不安装该插件会造成视频及相册模版竖排的日志信息缺失一项，视觉上不是很美观。 Post Views插件设置，最上面的三项选择如图： &amp;#160; 用什么工具修改主题模版文件 按教程修改模版时，请在后台主题编辑功能中修改，或者使用Notepad++文本编辑软件，决不能用系统自带的记事本，否则可能会造成错位或乱码。 还有些什么问题想到了再加.... 另外，还可以参考此篇文章：http://zmingcx.com/hotnewspro24-problem-summary.html&lt;img src=&quot;http://www1.feedsky.com/t1/602877065/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877065/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>HotNews主题</category><pubDate>Thu, 02 Feb 2012 07:38:49 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/some-scattered-new-the-the-notes-written-with-the-the-the-wp.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4842</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/some-scattered-new-the-the-notes-written-with-the-the-the-wp.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/602877065/5172474</fs:itemid></item><item><title>Firefox 10长期支持版本正式发布,扩展静默升级</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877066/5172474/1/item.html</link><content:encoded>&lt;p&gt;Mozilla于本周二全球同步发布Firefox 10浏览器，新版本简化了插件兼容性，还实现支持扩展静默升级，即可自动禁用不兼容插件。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7012/6805324869_49c36e6858_b.jpg&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://farm8.staticflickr.com/7012/6805324869_49c36e6858_b.jpg&quot; alt=&quot;&quot; width=&quot;670&quot; height=&quot;485&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;据悉，Firefox 10支持Windows, Mac和Linux平台。新版本大幅提升火狐扩展的兼容性，将默认兼容扩展版本升级，简化了火狐升级流程。&lt;/p&gt;
&lt;p&gt;此外，兼容Firefox 4及更高版本火狐的插件在Firefox 10中被标记为兼容插件。Mozilla去年制定了Firefox每六周升级一次的产品升级政策。自从Mozilla采用更快速的产品升级政策以来，用户就经常抱怨插件不兼容，这主要是因为插件开发人员不能及时修改插件代码或至少将插件标记为适用于最新浏览器的插件。&lt;/p&gt;
&lt;p&gt;而此在Firefox 10中，最大的变化就在于标记插件的兼容性，此前插件与新版Firefox不兼容的局面将不会出现。从Firefox 10开始，80%的插件将被标记为兼容。&lt;/p&gt;
&lt;p&gt;除此之外，Firefox 10还为网站和网络应用引入了Mozilla全屏API，全屏API让开发者可以创建全屏游戏、视频体验和演示共享功能。&lt;/p&gt;
&lt;p&gt;同时，Mozilla还宣布Firefox 10是首个“长期支持版本”(Extended Support Release，简称“ESR”)。长期支持版本是Mozilla专门为那些无法或不愿每隔六周就升级一次的企业打造。Firefox ESR版的升级周期为42周，而普通Firefox的升级周期为6周。&lt;/p&gt;
&lt;p&gt;根据Mozilla的版本发布周期，Firefox 11将会提供更加快速的原生Android界面，并在6月5日发布的Firefox 13中实现完全静默升级。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/602877066/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877066/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/firefox-10-released-to-support-expansion-of-silent-upgrade.html/feed</wfw:commentRss><slash:comments>5</slash:comments><description>Mozilla于本周二全球同步发布Firefox 10浏览器，新版本简化了插件兼容性，还实现支持扩展静默升级，即可自动禁用不兼容插件。 据悉，Firefox 10支持Windows, Mac和Linux平台。新版本大幅提升火狐扩展的兼容性，将默认兼容扩展版本升级，简化了火狐升级流程。 此外，兼容Firefox 4及更高版本火狐的插件在Firefox 10中被标记为兼容插件。Mozilla去年制定了Firefox每六周升级一次的产品升级政策。自从Mozilla采用更快速的产品升级政策以来，用户就经常抱怨插件不兼容，这主要是因为插件开发人员不能及时修改插件代码或至少将插件标记为适用于最新浏览器的插件。 而此在Firefox 10中，最大的变化就在于标记插件的兼容性，此前插件与新版Firefox不兼容的局面将不会出现。从Firefox 10开始，80%的插件将被标记为兼容。 除此之外，Firefox 10还为网站和网络应用引入了Mozilla全屏API，全屏API让开发者可以创建全屏游戏、视频体验和演示共享功能。 同时，Mozilla还宣布Firefox 10是首个“长期支持版本”(Extended Support Release，简称“ESR”)。长期支持版本是Mozilla专门为那些无法或不愿每隔六周就升级一次的企业打造。Firefox ESR版的升级周期为42周，而普通Firefox的升级周期为6周。 根据Mozilla的版本发布周期，Firefox 11将会提供更加快速的原生Android界面，并在6月5日发布的Firefox 13中实现完全静默升级。&lt;img src=&quot;http://www1.feedsky.com/t1/602877066/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877066/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>网文资讯</category><category>Firefox 10</category><category>Firefox</category><pubDate>Thu, 02 Feb 2012 02:02:11 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/firefox-10-released-to-support-expansion-of-silent-upgrade.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4858</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/firefox-10-released-to-support-expansion-of-silent-upgrade.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/602877066/5172474</fs:itemid></item><item><title>《优化一下HotNews Pro主题SEO代码》一文的补充</title><link>http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877067/5172474/1/item.html</link><content:encoded>&lt;p&gt;可能有些童鞋在使用&lt;a title=&quot;优化一下HotNews Pro主题SEO代码&quot; href=&quot;http://zmingcx.com/simply-look-hotnews-pro-theme-seo-optimized-code.html&quot; target=&quot;_blank&quot;&gt;《优化一下HotNews Pro主题SEO代码》&lt;/a&gt;中提供的优化代码后发现，用站长工具检测分类页面描述是空的，但查看源代码却显示有描述（description），不过描述内容前后有〈P〉〈/P〉标签，问题就在这了，搜索爬虫可能会认为这并非是文章的描述，所以并不抓取。&lt;/p&gt;
&lt;p&gt;这个〈P〉〈/P〉标签是下面这句调用WP分类描述函数&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span&gt; category_description( &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$categoryID&lt;/span&gt;&lt;span&gt; ); ?&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;自动生成的。&lt;/p&gt;
&lt;p&gt;解决办法：&lt;/p&gt;
&lt;p&gt;方法一，自动生成的〈P〉〈/P〉标签，是由WP程序文件default-filters.php第120行（wp版本3.31）：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;add_filter( &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$filter&lt;/span&gt;&lt;span&gt;, 'wpautop' ); &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;这句代码自动添加的，删除即可，但需修改程序文件，不推荐。&lt;/p&gt;
&lt;p&gt;方法二，用&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;func&quot;&gt; strip_tags&lt;/span&gt;&lt;span&gt;(category_description(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$cat_ID&lt;/span&gt;&lt;span&gt;)); ?&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;替换上面调用分类描述代码。&lt;/p&gt;
&lt;p&gt;方法三，把下面代码加到主题的functions.php模版文件中：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; deletehtml(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$description&lt;/span&gt;&lt;span&gt;) {    &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;vars&quot;&gt;$description&lt;/span&gt;&lt;span&gt; = trim(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$description&lt;/span&gt;&lt;span&gt;);    &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;vars&quot;&gt;$description&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;strip_tags&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$description&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt;);    &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$description&lt;/span&gt;&lt;span&gt;);   &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;}   &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;add_filter('category_description', 'deletehtml');  &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;注：使用方法三后，会造成HotNews Pro主题侧边推荐栏目小工具的分类描述的〈P〉〈/P〉标签也一同消失，影响到排版。&lt;/p&gt;
&lt;p&gt;主题搞复杂了就麻烦，牵一发而动全身。&lt;/p&gt;
&lt;p&gt;解决办法：&lt;/p&gt;
&lt;p&gt;打开HotNewspro\includes\widget目录的category_h.php找到：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;span &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;cat_description&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span&gt; category_description( &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$categoryID&lt;/span&gt;&lt;span&gt; ); ?&amp;gt;&amp;lt;/span&amp;gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;替换为：&lt;/p&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;lt;span &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;cat_description&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;lt;p&amp;gt;&amp;lt;?php &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;echo&lt;/span&gt;&lt;span&gt; category_description( &lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$categoryID&lt;/span&gt;&lt;span&gt; ); ?&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/span&amp;gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;就是给描述部分手工再添加个〈P〉标签。&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;注：请使用Notepad++、EmEditor、EditPlus文本编辑工具编辑修改中文主题模板，中文模版编码格式为：UTF-8 无BOM，保存时注意编码格式，否则会出现不可预知的问题。&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;参考：&lt;/p&gt;
&lt;p&gt;&lt;a title=&quot;get rid of p tags in category_description&quot; href=&quot;http://wordpress.org/support/topic/get-rid-of-p-tags-in-category_description&quot; target=&quot;_blank&quot;&gt;http://wordpress.org/support/topic/get-rid-of-p-tags-in-category_description&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title=&quot;去掉wordpress分类描述的&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;标签以及换行&quot; href=&quot;http://www.yangwo.net/98/&quot; target=&quot;_blank&quot;&gt;http://www.yangwo.net/98/&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/602877067/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877067/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://zmingcx.com/what-hotnews-pro-theme-seo-optimized-code-the-supplement.html/feed</wfw:commentRss><slash:comments>25</slash:comments><description>可能有些童鞋在使用《优化一下HotNews Pro主题SEO代码》中提供的优化代码后发现，用站长工具检测分类页面描述是空的，但查看源代码却显示有描述（description），不过描述内容前后有〈P〉〈/P〉标签，问题就在这了，搜索爬虫可能会认为这并非是文章的描述，所以并不抓取。 这个〈P〉〈/P〉标签是下面这句调用WP分类描述函数 &amp;#60;?php echo category_description( $categoryID ); ?&amp;#62; 自动生成的。 解决办法： 方法一，自动生成的〈P〉〈/P〉标签，是由WP程序文件default-filters.php第120行（wp版本3.31）： add_filter( $filter, 'wpautop' ); 这句代码自动添加的，删除即可，但需修改程序文件，不推荐。 方法二，用 &amp;#60;?php echo strip_tags(category_description($cat_ID)); ?&amp;#62; 替换上面调用分类描述代码。 方法三，把下面代码加到主题的functions.php模版文件中： function deletehtml($description) {     $description = trim($description);     $description = strip_tags($description,&quot;&quot;);     return ($description);    }    add_filter('category_description', 'deletehtml');   注：使用方法三后，会造成HotNews Pro主题侧边推荐栏目小工具的分类描述的〈P〉〈/P〉标签也一同消失，影响到排版。 主题搞复杂了就麻烦，牵一发而动全身。 解决办法： 打开HotNewspro\includes\widget目录的category_h.php找到： &amp;#60;span class=&quot;cat_description&quot;&amp;#62;&amp;#60;?php echo category_description( $categoryID ); ?&amp;#62;&amp;#60;/span&amp;#62;   替换为： &amp;#60;span class=&quot;cat_description&quot;&amp;#62;&amp;#60;p&amp;#62;&amp;#60;?php echo category_description( $categoryID ); ?&amp;#62;&amp;#60;/p&amp;#62;&amp;#60;/span&amp;#62;   就是给描述部分手工再添加个〈P〉标签。 注：请使用Notepad++、EmEditor、EditPlus文本编辑工具编辑修改中文主题模板，中文模版编码格式为：UTF-8 无BOM，保存时注意编码格式，否则会出现不可预知的问题。 &amp;#160; 参考： http://wordpress.org/support/topic/get-rid-of-p-tags-in-category_description http://www.yangwo.net/98/&lt;img src=&quot;http://www1.feedsky.com/t1/602877067/zmingcx/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/zmingcx/~8078099/602877067/5172474/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>HotNews主题</category><pubDate>Wed, 01 Feb 2012 11:04:42 +0800</pubDate><author>知更鸟</author><comments>http://zmingcx.com/what-hotnews-pro-theme-seo-optimized-code-the-supplement.html#comments</comments><guid isPermaLink="false">http://zmingcx.com/?p=4857</guid><dc:creator>知更鸟</dc:creator><fs:srclink>http://zmingcx.com/what-hotnews-pro-theme-seo-optimized-code-the-supplement.html</fs:srclink><fs:srcfeed>http://zmingcx.com/feed</fs:srcfeed><fs:itemid>feedsky/zmingcx/~8078099/602877067/5172474</fs:itemid></item></channel></rss>
