<?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>網生@誌 &#124; zEUS.&#039;Blog &#187; The Loop</title>
	<atom:link href="http://zeuscn.net/index.php/archives/tag/the-loop/feed" rel="self" type="application/rss+xml" />
	<link>http://zeuscn.net</link>
	<description>Not Only Wordpress Template, But Also My Life...</description>
	<lastBuildDate>Tue, 03 Jan 2012 13:20:32 +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>WordPress 调用单个分类文章列表</title>
		<link>http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html</link>
		<comments>http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html#comments</comments>
		<pubDate>Wed, 12 Mar 2008 12:42:34 +0000</pubDate>
		<dc:creator>zEUS.</dc:creator>
				<category><![CDATA[Wordpress研究]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[Query_posts]]></category>
		<category><![CDATA[The Loop]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories/</guid>
		<description><![CDATA[为了让 ipple utral 看起来更像是一个 CMS 主题，在首页上我调用了“动漫动画”、“WordPress主题”等几个分类的文章列表，用于充实内容。一般传统的 WordPress 主题里很少见到有调用单个分类文章的文章列表，所以对于这个技巧绝大多数朋友可能还都不知道。这里我就简单的介绍一下： 这里涉及到2个“知识点”——The Loop 和 Query_posts() 函数。 The Loop 的解释比较复杂，但我们可以简单的将其理解为：文章输出循环，也就是说我们想要输出和文章相关的内容（标题、内容、摘要等）时，就必须用到 The Loop，在 index.php、 page.php、single.php、search.php、archive.php 等文件里都用到了 The Loop，基本上每个 The Loop 都始于： 止于： Query_posts() 函数与 The Loop 配合使用时就能控制输出各种类型的文章，是的，Query_posts() 实质就是 The Loop 的输出条件，下面是我在 ipple utral 首页上用到的一个例子，结合我前面的2篇文章（WordPress 中 categories 的用法 和 wp_list_categories 参数详解）相信你一定看的懂下面的代码： //输出 ID 为11的分类的标题 //输出 ID 为11的分类的描述 //query_posts 给 The Loop [...]]]></description>
			<content:encoded><![CDATA[<p>为了让 ipple utral 看起来更像是一个 CMS 主题，在首页上我调用了“<a href="http://zeuscn.net/archives/category/comics/" target="_blank" />动漫动画</a>”、“<a href="http://zeuscn.net/archives/category/wordpressthemes/" target="_blank" />WordPress主题</a>”等几个分类的文章列表，用于充实内容。一般传统的 <a href="http://zeuscn.net/archives/tag/wordpress" class="st_tag internal_tag" rel="tag" title="标签 wordpress 下的日志">WordPress</a> 主题里很少见到有调用单个分类文章的文章列表，所以对于这个技巧绝大多数朋友可能还都不知道。这里我就简单的介绍一下：</p>
<p></p>
<p>这里涉及到2个“知识点”——<strong><a href="http://zeuscn.net/archives/tag/the-loop" class="st_tag internal_tag" rel="tag" title="标签 The Loop 下的日志">The Loop</a></strong> 和 <strong><a href="http://zeuscn.net/archives/tag/query_posts" class="st_tag internal_tag" rel="tag" title="标签 Query_posts 下的日志">Query_posts</a>() 函数</strong>。<br />
The Loop 的解释比较复杂，但我们可以简单的将其理解为：文章输出循环，也就是说我们想要输出和文章相关的内容（标题、内容、摘要等）时，就必须用到 The Loop，在 index.php、 page.php、single.php、search.php、archive.php 等文件里都用到了 The Loop，基本上每个 The Loop 都始于：<br />
<span id="more-354"></span><br />
<coolcode linenum="off" lang="php"><br />
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?><br />
</coolcode><br />
止于：<br />
<coolcode linenum="off" lang="php"><br />
<?php endwhile; else: ?></p>
<p><?php endif; ?><br />
</coolcode></p>
<p></p>
<p>Query_posts() 函数与 The Loop 配合使用时就能控制输出各种类型的文章，是的，Query_posts() 实质就是 The Loop 的输出条件，下面是我在 ipple utral 首页上用到的一个例子，结合我前面的2篇文章（<a href="http://zeuscn.net/archives/2008/03/11/how-to-set-wp_list_categories/" target="_blank">WordPress 中 categories</a> 的用法 和 <a href="http://zeuscn.net/archives/2008/03/11/parameters-of-wp_list_categories/" target="_blank">wp_list_categories 参数详解</a>）相信你一定看的懂下面的代码：<br />
<coolcode linenum="off" lang="php"></p>
<h2><?php wp_list_categories('include=11&#038;title_li=&#038;style=none'); ?></h2>
<p>  //输出 ID 为11的分类的标题</p>
<p><?php echo category_description(11); ?>  //输出 ID 为11的分类的描述</p>
<p><?php query_posts('showposts=5&#038;cat=11'); ?>  //query_posts 给 The Loop 限定的条件是：显示5篇日志和分类 ID 为11</p>
<p><?php while (have_posts()) : the_post(); ?>  //The Loop 开始</p>
<li><a href="<?php the_permalink() ?>” rel=”bookmark” class=”title”><?php the_title(); ?></a></li>
<p>  //用列表的方式输出带有链接的文章标题</p>
<p><?php endwhile; ?>  //The Loop 结束<br />
</coolcode></p>
<p></p>
<p><strong>调用分类文章列表</strong>其实只是 Query_posts() 函数与 The Loop 的一个简单应用，当你看完 WordPress 官方文档里 <a href="http://codex.wordpress.org/Template_Tags/query_posts" target="_blank">query_posts</a> 和 <a href="http://codex.wordpress.org/The_Loop" target="_blank">The Loop</a> 用法的文章后，相信你能实现更多自己想要的文章输出方式  <img src='http://zeuscn.net/wp-includes/images/smilies/icon_wink.gif' alt=':wink:' class='wp-smiley' />  </p>
<p align=right>zEUS.</p>
<hr /><h2>日志评论</h2><ul><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 五月 25日</a>, hello writes: “输出 ID 为11的分类的标题”这个ID能不能让系统自己调用？</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 七月 19日</a>, <a href='http://blogcn.wordpress.com.cn' rel='external nofollow' class='url'>wordpress主题制作站</a> writes: 不知道有演示的站点不啊？ :cool:</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 七月 19日</a>, <a href='http://zeuscn.net/' rel='external nofollow' class='url'>zEUS.</a> writes: [Comment ID #4876 Will Be Quoted Here]
试试这个：zeuscn.net/demo</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 七月 29日</a>, <a href='http://www.girlqiqi.cn' rel='external nofollow' class='url'>googlefish</a> writes: 如果首页一共调用了三个栏目,从上到下排版.当某个栏目有新的日志发表时,我想让这个栏目处于最上面,有什么好的办法实现吗? 先谢谢了.</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 七月 30日</a>, <a href='http://zeuscn.net/' rel='external nofollow' class='url'>zEUS.</a> writes: @googlefish：额。。 :idea:  不知道咋搞。。。</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 八月 6日</a>, <a href='http://www.futongbanwang.com' rel='external nofollow' class='url'>futongban</a> writes: 你的代码真好用，你的注析太好了，很多其他人的代码没有解析，看不懂啊。谢谢了</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 八月 15日</a>, <a href='http://kingice.idchd.com/?p=21' rel='external nofollow' class='url'>YY吧 &raquo; Blog Archive &raquo; WordPress 调用单个分类文章列表</a> writes: [...] http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories/ [...]</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 八月 19日</a>, <a href='http://www.dianzishangwurencai.cn' rel='external nofollow' class='url'>hurri</a> writes: 为什么我调用 分类描述 到title

会出现分类描述？

例：http://www.dianzishangwurencai.cn/quzhou-seo

谢谢！</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 八月 19日</a>, <a href='http://zeuscn.net/' rel='external nofollow' class='url'>zEUS.</a> writes: @hurri：你在自问自答？</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 十月 27日</a>, <a href='http://xueshen.net/' rel='external nofollow' class='url'>雪深</a> writes: 不知道楼主能不能提供一个关于新建页面 调用某一分类  （标题+摘要） 实现分页的方案</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 十月 28日</a>, <a href='http://zeuscn.net/' rel='external nofollow' class='url'>zEUS.</a> writes: 哦？！这个方法网上没有介绍吗？
那找个时间我来写一篇吧～</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 十月 28日</a>, <a href='http://zeuscn.net/' rel='external nofollow' class='url'>zEUS.</a> writes: 刚找到了一篇教程，你先看看吧～
http://smartr.cn/wordpress/set-up-your-special-post-page.html</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2008年, 十一月 24日</a>, <a href='http://www.leinky.com' rel='external nofollow' class='url'>小墨</a> writes: :arrow: 好用的代码，用来定义sitemap了~
多谢~</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2009年, 四月 1日</a>, <a href='http://www.digglife.cn' rel='external nofollow' class='url'>摩摩诘</a> writes: 又搜到你这里来啦...仔细学习一下...</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2009年, 四月 1日</a>, <a href='http://www.digglife.cn' rel='external nofollow' class='url'>摩摩诘</a> writes: 其实你不是第一个结果,但是我一看就知道别人是抄袭你的,结果排名还在你前面,无语了...</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2009年, 四月 20日</a>, <a href='http://udcon.com' rel='external nofollow' class='url'>hysteria</a> writes: 我想在wordpress的侧边栏调用某一分类下的日志，按照你这个方法成功了

但也出现了一个很严重的问题：
单篇的日志页面以及page页面内容都一样了，内容都是调用的这个分类下日志内容

请问有没有什么好的解决方法...</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2009年, 五月 18日</a>, <a href='http://在建' rel='external nofollow' class='url'>fengyue</a> writes: 写汉字和大家分享wordpress经验的人，好像只有你和水煮鱼。

革命先驱啊！</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2009年, 五月 19日</a>, <a href='http://zeuscn.net/' rel='external nofollow' class='url'>zEUS.</a> writes: 呵呵，其实还有好多朋友也在分享Wordpress经验呀，我比较熟的就有 http://www.saywp.com/ 和 http://www.happinesz.cn/
他们都蛮厉害的！</li><li><a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">2012年, 一月 24日</a>, <a href='http://www.humanchorus.org/' rel='external nofollow' class='url'>classic country music artists</a> writes: <strong>Sites We Like...</strong>

[...]just below, are some totally unrelated sites to ours, however, they are definitely worth checking out[...]...</li></ul><hr /><p>本文地址：<a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html">http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-<a href="http://zeuscn.net/archives/tag/categories" class="st_tag internal_tag" rel="tag" title="标签 categories 下的日志">categories</a>.html</a>，转载原创文章请注明 <a href="http://zeuscn.net/">zEUScn.NET</a> ‖
      您可以直接 <a href="http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html#comments"title="to the comments">发布评论</a>
      </p>
    <p>Copyright©<a href="%%blogurl%%">zEUScn.NET</a>.Some rights reserved.</p>
(Digital Fingerprint:<br /> 05538bd2e0492fe803256b5788cfa6fd)
	<ul class="st-related-posts">
	<li><a href="http://zeuscn.net/archives/2008/09/11/wordpress-cms-index.html" title="WordPress 较常用的首页文章 CMS 排版方法 (2008年, 九月 11日)">WordPress 较常用的首页文章 CMS 排版方法</a> (109)</li>
	<li><a href="http://zeuscn.net/archives/2008/10/26/diary-5.html" title="又见日记 (2008年, 十月 26日)">又见日记</a> (39)</li>
	<li><a href="http://zeuscn.net/archives/2009/10/29/which-is-the-next-theme.html" title="Which is The Next Theme ? (2009年, 十月 29日)">Which is The Next Theme ?</a> (45)</li>
	<li><a href="http://zeuscn.net/archives/2007/08/16/plugins-support-chinese.html" title="让wordpress插件彻底支持中文！ (2007年, 八月 16日)">让wordpress插件彻底支持中文！</a> (19)</li>
	<li><a href="http://zeuscn.net/archives/2008/07/25/plans-of-wordpress-themes-2.html" title="近期关于 WordPress 主题的一些计划 (2008年, 七月 25日)">近期关于 WordPress 主题的一些计划</a> (23)</li>
	<li><a href="http://zeuscn.net/archives/2010/02/09/ipple-lite-v2-test.html" title="Ipple Lite V2 小范围测试 (2010年, 二月 9日)">Ipple Lite V2 小范围测试</a> (28)</li>
	<li><a href="http://zeuscn.net/archives/2007/10/15/more-text-modules.html" title="给 Widgets 增加更多的 TEXT 模块 (2007年, 十月 15日)">给 Widgets 增加更多的 TEXT 模块</a> (78)</li>
	<li><a href="http://zeuscn.net/archives/2008/03/26/notice-about-ipple-theme.html" title="Notice：QQ 满员，请加群，谢谢支持 (2008年, 三月 26日)">Notice：QQ 满员，请加群，谢谢支持</a> (9)</li>
	<li><a href="http://zeuscn.net/archives/2009/11/01/lightbox-for-wordpress-without-plugins-2.html" title="无插件实现 WordPress Lightbox 特效 (2009年, 十一月 1日)">无插件实现 WordPress Lightbox 特效</a> (89)</li>
	<li><a href="http://zeuscn.net/archives/2011/08/05/sae-wordpress.html" title="国内免费高速图床——SAE 免费搭建 WordPress (2011年, 八月 5日)">国内免费高速图床——SAE 免费搭建 WordPress</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://zeuscn.net/archives/2008/03/12/lists-of-wordpress-categories.html/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

