<?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>wpCanyon &#187; read more</title>
	<atom:link href="http://wpcanyon.com/tag/read-more/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpcanyon.com</link>
	<description>Wordpress tutorials, articles, hacks, tricks and many more</description>
	<lastBuildDate>Thu, 10 Feb 2011 01:21:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Different &#8220;Read More&#8221; Link For Different Categories</title>
		<link>http://wpcanyon.com/tipsandtricks/different-read-more-link-for-different-categories/</link>
		<comments>http://wpcanyon.com/tipsandtricks/different-read-more-link-for-different-categories/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 02:19:02 +0000</pubDate>
		<dc:creator>Boba</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[read more]]></category>

		<guid isPermaLink="false">http://wpcanyon.com/?p=194</guid>
		<description><![CDATA[As you can see here on wpcanyon, the "read more" links have different text depending on the category of the posts. Here is how to do that.]]></description>
			<content:encoded><![CDATA[<p>Place the code bellow in your theme&#8217;s <strong>function.php</strong> file.</p>
<pre class="brush: php;">
function readMore(){
	$categoryDetails = get_the_category($post-&gt;ID);
	$categoryID = $categoryDetails[0]-&gt;cat_ID;

	switch ($categoryID):

		case 1:
			$readMoreText = 'Continue reading this tutorial';
			break;
		case 2:
			$readMoreText = 'Watch screencast';
			break;
		default:
			$readMoreText = 'Continue Reading';

	endswitch;

	echo '&lt;p&gt;&lt;a title=&quot;Permanent Link to '.get_the_title().'&quot; href=&quot;'.get_permalink().'&quot;&gt;'.$readMoreText.'&lt;/a&gt;&lt;/p&gt;';
}
</pre>
<p>The number after the <strong>case</strong> is ID of a category. To easily find out IDs of your categories simply go to the categories page in wordpress admin and by hovering over the category names you will see a link like &#8220;&#8230;wp-admin/categories.php?action=edit&#038;<strong>cat_ID=5</strong>&#8220;.</p>
<p>Now simply call the <strong>readMore()</strong> function wherever you want to show the link.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanyon.com/tipsandtricks/different-read-more-link-for-different-categories/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

