<?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>FVF.me&#039;Ye &#187; 楼层数</title>
	<atom:link href="http://fvf.me/tag/%e6%a5%bc%e5%b1%82%e6%95%b0/feed" rel="self" type="application/rss+xml" />
	<link>http://fvf.me</link>
	<description>我是孤独的根号5</description>
	<lastBuildDate>Mon, 19 Sep 2011 12:10:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>WordPress 评论添加楼层数(留言编号)</title>
		<link>http://fvf.me/wordpress/tips/comments-add-a-few-floors-wordpress-message-number.html</link>
		<comments>http://fvf.me/wordpress/tips/comments-add-a-few-floors-wordpress-message-number.html#comments</comments>
		<pubDate>Wed, 05 Aug 2009 11:02:07 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[小技巧]]></category>
		<category><![CDATA[楼层数]]></category>
		<category><![CDATA[评论]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/comments-add-a-few-floors-wordpress-message-number.html</guid>
		<description><![CDATA[今天在全力搞评论页也就是comments.php，整个主题之中就属它最麻烦和复杂了！搞得头痛死了！ 我刚刚把普通的评论和trackbacks / pingbacks分开,准备给评论加上楼层数！不懂怎么办！当然是在Google上找喽！找方法当然是找简单的了终于找到了以下的简单方法！ 编辑 comments.php 文件，找到以下评论循环的入口代码： &#60;?php foreach ($comments as $comment) : ?&#62; 在这句代码之前添加： &#60;?php $i=1; ?&#62; //初始化 $i 变量，赋值 1 在需要显示楼层编号的地方，插入以下代码，当然，如何呈现需要可以自定义样式： #&#60;?php echo $i; ?&#62;楼 //输出楼层编号 每次评论循环函数执行后，对 $count 变量进行加 1 操作，因此需找到： &#60;?php endforeach; ?&#62; 在此循环结束之前加入： &#60;?php $i++; ?&#62; //$i 变量自加 1]]></description>
			<content:encoded><![CDATA[<p>今天在全力搞评论页也就是comments.php，整个主题之中就属它最麻烦和复杂了！搞得头痛死了！</p>
<p>我刚刚把普通的评论和trackbacks / pingbacks分开,准备给评论加上楼层数！不懂怎么办！当然是在Google上找喽！找方法当然是找简单的了终于找到了以下的简单方法！</p>
<p>编辑 comments.php 文件，找到以下评论循环的入口代码：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">foreach</span> (<span style="color: rgb(204, 204, 0); ">$comments</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">as</span> <span style="color: rgb(204, 204, 0); ">$comment</span>) <span style="color: rgb(192, 192, 192); ">:</span> <span style="color: rgb(255, 255, 255); ">?&gt;</span></div>
<p>在这句代码之前添加：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(204, 204, 0); ">$i</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">1</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> <span style="color: rgb(192, 192, 192); ">//初始化 $i 变量，赋值 1</span></div>
<p>在需要显示楼层编号的地方，插入以下代码，当然，如何呈现需要可以自定义样式：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(192, 192, 192); ">#</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$i</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(192, 192, 192); ">楼</span><br /> <span style="color: rgb(192, 192, 192); ">//输出楼层编号</span></div>
<p>每次评论循环函数执行后，对 $count 变量进行加 1 操作，因此需找到：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">endforeach</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span></div>
<p>在此循环结束之前加入：</p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(204, 204, 0); ">$i</span><span style="color: rgb(192, 192, 192); ">++</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> <span style="color: rgb(192, 192, 192); ">//$i 变量自加 1</span></div>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/tips/comments-add-a-few-floors-wordpress-message-number.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

