<?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>WebDeveloperss.com &#187; Code</title>
	<atom:link href="http://www.webdeveloperss.com/blog/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdeveloperss.com/blog</link>
	<description>Hand-Picked Best Of The Web Developer Blogs</description>
	<lastBuildDate>Wed, 10 Feb 2010 08:21:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick Tip: Using WordPress Slug-based Category Templates</title>
		<link>http://www.webdeveloperss.com/blog/2010/01/quick-tip-using-wordpress-slug-based-category-templates/</link>
		<comments>http://www.webdeveloperss.com/blog/2010/01/quick-tip-using-wordpress-slug-based-category-templates/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 18:05:05 +0000</pubDate>
		<dc:creator>Lorraine Nepomuceno</dc:creator>
				<category><![CDATA[Feeder]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[If you create custom themes for Wordpress, chances are you’ve already used category templates in the past. They usually look like this:
category-x.php
where x corresponds to the ID number of the category, and are extremely useful if you want to give ...]]></description>
			<content:encoded><![CDATA[<p><span style="background-color:yellow">Link To Full Story:</span> <a href="http://feedproxy.google.com/~r/Devlounge/~3/KVRWm-mU-9A/quick-tip-using-wordpress-slug-based-category-templates" target="blank">Devlounge - Homepage Feed </a></p>

<p>If you create custom themes for Wordpress, chances are you’ve already used category templates in the past. They usually look like this:</p>
<p><em>category-x.php</em></p>
<p>where x corresponds to the ID number of the category, and are extremely useful if you want to give a specific category a certain look. For example, if you wanted to add an “Asides” area to your theme, you’d create a category named Asides, get the numerical ID of that category (e.g. “3″) and create a template file named <em>category-3.php</em></p>
<p>My problem, of course, was having to find the ID of the category, which could vary from one WP installation to another. The truth is that I usually chose to go the route of conditional queries instead, doing something like this:</p>
<blockquote><p>if ( is_category(‘asides’) ) {<br>
// what I’d like to show for my asides<br>
}</p></blockquote>
<p>Wordpress 2.9, however, has added support for slug-based category templates. So instead of naming my template <em>category-3.php</em>, I can go ahead and name it something wonderfully semantic like <em>category-asides.php</em></p>
<p>The hierarchy in which Wordpress looks for which template to use has been updated as well. Now, it’ll look for the slug-based template first, <em>then</em> the ID-based template, and finally the default template.</p>
<p>Do you use Wordpress category templates in your themes?</p>
<div>
<a href="http://feeds.feedburner.com/~ff/Devlounge?a=KVRWm-mU-9A:NnUxG6V-ao4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Devlounge?d=yIl2AUoC8zA" border="0"></a> <a href="http://feeds.feedburner.com/~ff/Devlounge?a=KVRWm-mU-9A:NnUxG6V-ao4:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Devlounge?d=dnMXMwOfBR0" border="0"></a> <a href="http://feeds.feedburner.com/~ff/Devlounge?a=KVRWm-mU-9A:NnUxG6V-ao4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Devlounge?d=7Q72WNTAKBA" border="0"></a> <a href="http://feeds.feedburner.com/~ff/Devlounge?a=KVRWm-mU-9A:NnUxG6V-ao4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Devlounge?i=KVRWm-mU-9A:NnUxG6V-ao4:D7DqB2pKExk" border="0"></a> <a href="http://feeds.feedburner.com/~ff/Devlounge?a=KVRWm-mU-9A:NnUxG6V-ao4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Devlounge?i=KVRWm-mU-9A:NnUxG6V-ao4:V_sGLiPBpWU" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/Devlounge/~4/KVRWm-mU-9A" height="1" width="1">]]></content:encoded>
			<wfw:commentRss>http://www.webdeveloperss.com/blog/2010/01/quick-tip-using-wordpress-slug-based-category-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
