<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>WordPress 非官方中文站 &#187; 置顶</title> <atom:link href="http://wpchina.org/tag/top-article/feed/" rel="self" type="application/rss+xml" /><link>http://wpchina.org</link> <description>提供 WordPress 插件、主题、程序及相关的中文资讯</description> <lastBuildDate>Tue, 15 May 2012 01:33:00 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>Classic Post Plugin，WordPress 经典文章(置顶)插件</title><link>http://wpchina.org/classic-post-wordpress-plugin-191/</link> <comments>http://wpchina.org/classic-post-wordpress-plugin-191/#comments</comments> <pubDate>Mon, 21 Apr 2008 17:30:27 +0000</pubDate> <dc:creator>Jiang</dc:creator> <category><![CDATA[主题使用]]></category> <category><![CDATA[文章]]></category> <category><![CDATA[置顶]]></category><guid isPermaLink="false">http://wpchina.org/classic-post-wordpress-plugin-191/</guid> <description><![CDATA[很多网友都已经看到了，在我们 WordPress 中文站的博客首页，最上面的一篇文章，并不是最新的博客文章，而是一篇关于 WordPress 2.5 发布更新的文章。相信你已经知道，在一版网站或论坛上，将这种文章称之为置顶文章（也有的论坛使用置底文章，比如各种BBS系统）。今天我们就来给大家介绍一下这款经典文章插件：Classic Post Plugin，使用它可以实现我们所说的置顶功能。]]></description> <content:encoded><![CDATA[<p><p>很多网友都已经看到了，在我们 <a href="http://wpchina.org/" target="_blank">WordPress 中文站</a>的<a href="http://wpchina.org/blog/" target="_blank">博客首页</a>，最上面的一篇文章，并不是最新的博客文章，而是一篇关于 <a href="http://wpchina.org/wordpress-25-chinese-version-released-142/" target="_blank">WordPress 2.5 发布更新的文章</a>。相信你已经知道，在一版网站或论坛上，将这种文章称之为<strong>置顶文章</strong>（也有的论坛使用置底文章，比如各种BBS系统）。今天我们就来给大家介绍一下这款经典文章插件：<strong>Classic Post Plugin</strong>，使用它可以实现我们所说的置顶功能。</p><p><a href="http://www.chrisvschris.com/classic-posts/" target="_blank">Classic Post Plugin</a>，经典文章插件，其作用就是将你认为经典（或重要，或需要特别显示）的文章，放到你所需要的地方。当前版本 <a href="http://www.chrisvschris.com/plugins/classic_posts.zip" target="_blank">Classic Post Plugin 1.1</a>，此插件作者仅在 WP 2.1 以及更高版本中测试过；经过本站测试，2.3 版本下工作正常。更新：根据 <a href="http://www.aftertown.cn/" target="_blank">Patrick</a> 网友测试，此插件在 WordPress 2.5 下不能工作。</p><p>下面我们就来看看如何使用 Classic Post Plugin 插件：</p><ol><li>下载、解压缩此插件，并上传到你的服务器上 &lt;WordPress安装目录&gt;/wp-content/plugins/ 目录内；（如果你的<a href="http://wpchina.org/hosting/" target="_blank">主机</a>支持在线解压缩，也可以下载，上传之后在线解压缩）</li><li>登录 WordPress 控制台，在&#8220;插件&#8221;里启用此插件；</li><li>进入文章管理部分，在&#8220;管理 &#8211; 文章&#8221;处，选择你所需要置顶的文章，被选中的文章，文章后面的 Select 变成 Deselect；（后面附图）</li><li>在你所希望显示经典文章的模板处，插入代码（后面附图）： <br />`&lt;?php do_action(&#8216;classic_post_get(1,200)&#8217;); ?&gt;`；</li><li>在你希望展示经典文章列表的模板处，插入代码： <br />`&lt;?php do_action(&#8216;classic_post_get_list(5)&#8217;); ?&gt;`；</li></ol><p>下图为选择 Classic Post，将要置顶的文章：</p><p> <img title="classic post plugin" alt="classic post plugin" src="http://pic.wpchina.org/w-20080422-b001.png" /><p>下图为在 index.php 文件中添加代码，你也可以将代码添加到侧边拦或其它位置：</p><p> <img title="classic post plugin" alt="classic post plugin" src="http://pic.wpchina.org/w-20080422-b002.png" /><p>这是在 <a href="http://wpchina.org/" target="_blank">WordPress中文站</a> 上的显示效果：</p><p> <img title="classic post plugin" alt="classic post plugin" src="http://pic.wpchina.org/w-20080422-b003.png" /><p>最后，再说明一下，classic_post_get(1,200) 函数中，第一个参数为显示文章数目，第二个参数为显示的字数。但是，第二个参数似乎并不准确。&#8217;classic_post_get_list(5) 函数中，参数为文章数目，也就是显示5篇文章。</p> ]]></content:encoded> <wfw:commentRss>http://wpchina.org/classic-post-wordpress-plugin-191/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: wpchina.org @ 2012-05-24 01:46:21 -->
