<?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>陶●工作室 &#187; 相關文章</title>
	<atom:link href="http://taoworkshop.com/tag/%e7%9b%b8%e9%97%9c%e6%96%87%e7%ab%a0/feed/" rel="self" type="application/rss+xml" />
	<link>http://taoworkshop.com</link>
	<description>站長指南-Web hosting及WordPress設定</description>
	<lastBuildDate>Wed, 13 Mar 2013 11:39:28 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>WP: 為佈景主題加上相關文章</title>
		<link>http://taoworkshop.com/2012/01/03/show-related-post-no-plug-in/</link>
		<comments>http://taoworkshop.com/2012/01/03/show-related-post-no-plug-in/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 12:02:00 +0000</pubDate>
		<dc:creator><![CDATA[陶]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Template修改]]></category>
		<category><![CDATA[相關文章]]></category>

		<guid isPermaLink="false">http://taoworkshop.com/?p=353</guid>
		<description><![CDATA[在文章後端的加上相關文章的連結， 方便訪客閱讀相關文章。 在控制台選 1 外觀–&#62; 2 主題編<a href="http://taoworkshop.com/2012/01/03/show-related-post-no-plug-in/">&#160;&#160;[ Read More ]</a>]]></description>
				<content:encoded><![CDATA[<p>在文章後端的加上相關文章的連結，</p>
<p>方便訪客閱讀相關文章。</p>
<p>在控制台選 1 外觀–&gt; 2 主題編輯器–&gt; 3 修改single.php<br />
找類似</p>
<blockquote>
<pre>&lt;?php previous_post_link('%link') ?&gt;
&lt;?php next_post_link('%link') ?&gt;</pre>
</blockquote>
<p>在後面加上:</p>
<blockquote>
<pre>&lt;?php
$tags = wp_get_post_tags($post-&gt;ID);
if ($tags) {
$tag_ids = array();<span id="more-353"></span>
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag-&gt;term_id;

$args=array(
'tag__in' =&gt; $tag_ids,
'post__not_in' =&gt; array($post-&gt;ID),
'showposts'=&gt;5, // Number of related posts that will be shown.
'caller_get_posts'=&gt;1
);
$my_query = new wp_query($args);
if( $my_query-&gt;have_posts() ) {
echo '&lt;h3&gt;相關文章&lt;/h3&gt;&lt;ul&gt;';
while ($my_query-&gt;have_posts()) {
$my_query-&gt;the_post();
?&gt;
&lt;li&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="Permanent Link to &lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;?php
}
echo '&lt;/ul&gt;';
}
}
?&gt;</pre>
</blockquote>
<p>完成!</p>
<p>參考: <a href="http://www.bin-co.com/blog/2009/04/show-related-post-in-wordpress-without-a-plugin/">http://www.bin-co.com/blog/2009/04/show-related-post-in-wordpress-without-a-plugin/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://taoworkshop.com/2012/01/03/show-related-post-no-plug-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
