<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Wordpress Conditional Tags: Write Less Code</title>
	<atom:link href="http://curtishenson.com/wordpress-conditional-tags-write-less-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/</link>
	<description>Freelance Web Designer and Wordpress Guru</description>
	<lastBuildDate>Fri, 12 Mar 2010 21:17:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Curtis Henson</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2549</link>
		<dc:creator>Curtis Henson</dc:creator>
		<pubDate>Thu, 17 Sep 2009 21:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2549</guid>
		<description>Mathilde,

What you want to use is probably in_category() instead of is_category() and pass the ID of category X to in_category.

You can see an example at the bottom of &lt;a href=&quot;http://curtishenson.com/complex-wordpress-conditional-tags/&quot; rel=&quot;nofollow&quot;&gt;the follow up post Complex Conditionals&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Mathilde,</p>
<p>What you want to use is probably in_category() instead of is_category() and pass the ID of category X to in_category.</p>
<p>You can see an example at the bottom of <a href="http://curtishenson.com/complex-wordpress-conditional-tags/" rel="nofollow">the follow up post Complex Conditionals</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mathilde</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2548</link>
		<dc:creator>Mathilde</dc:creator>
		<pubDate>Thu, 17 Sep 2009 20:47:43 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2548</guid>
		<description>Botakedan is true. The code didn&#039;t work when you have more than one child category. 
I would like display several child categories with the same template. For example, all the categories which are children of the category X have the same template. 
Do you have an idea of how it can work ?</description>
		<content:encoded><![CDATA[<p>Botakedan is true. The code didn&#8217;t work when you have more than one child category.<br />
I would like display several child categories with the same template. For example, all the categories which are children of the category X have the same template.<br />
Do you have an idea of how it can work ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis Henson</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2377</link>
		<dc:creator>Curtis Henson</dc:creator>
		<pubDate>Mon, 01 Jun 2009 16:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2377</guid>
		<description>I&#039;m not sure what you are asking for.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure what you are asking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: botakedan</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2376</link>
		<dc:creator>botakedan</dc:creator>
		<pubDate>Mon, 01 Jun 2009 08:49:47 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2376</guid>
		<description>Just find out, that is will not work when child of the category more than one.</description>
		<content:encoded><![CDATA[<p>Just find out, that is will not work when child of the category more than one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: botakedan</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2375</link>
		<dc:creator>botakedan</dc:creator>
		<pubDate>Mon, 01 Jun 2009 08:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2375</guid>
		<description>if i want to create 3 child category... how is the script ???</description>
		<content:encoded><![CDATA[<p>if i want to create 3 child category&#8230; how is the script ???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rails</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2371</link>
		<dc:creator>Rails</dc:creator>
		<pubDate>Fri, 29 May 2009 08:05:19 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2371</guid>
		<description>Oh This is good for me. Thank</description>
		<content:encoded><![CDATA[<p>Oh This is good for me. Thank</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2267</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Tue, 21 Apr 2009 01:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2267</guid>
		<description>Works Perfectly!

thanks!</description>
		<content:encoded><![CDATA[<p>Works Perfectly!</p>
<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2264</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Mon, 20 Apr 2009 18:24:35 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2264</guid>
		<description>Thanks Curtis,

I will give it a try when I get home.

And again, I appreciate the help.</description>
		<content:encoded><![CDATA[<p>Thanks Curtis,</p>
<p>I will give it a try when I get home.</p>
<p>And again, I appreciate the help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis Henson</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2263</link>
		<dc:creator>Curtis Henson</dc:creator>
		<pubDate>Mon, 20 Apr 2009 17:30:36 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2263</guid>
		<description>Mark,

I did some testing and it turned out to be more complicated than I thought. This should work:
&lt;code&gt;
$cats = get_categories(&#039;child_of=4&#039;);

			foreach ($cats as $cat){
				$cats_array[] = $cat-&gt;cat_ID;
			}
			
			if ( is_category($cats_array) ) {
				//do stuff
			}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>I did some testing and it turned out to be more complicated than I thought. This should work:<br />
<code><br />
$cats = get_categories('child_of=4');</p>
<p>			foreach ($cats as $cat){<br />
				$cats_array[] = $cat->cat_ID;<br />
			}</p>
<p>			if ( is_category($cats_array) ) {<br />
				//do stuff<br />
			}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://curtishenson.com/wordpress-conditional-tags-write-less-code/comment-page-1/#comment-2257</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Mon, 20 Apr 2009 13:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://curtishenson.com/wordpress-conditional-tags-write-less-code/#comment-2257</guid>
		<description>Thanks for the reply... the second one is what I am after but can&#039;y seem to get it to work. here is my code:

&lt;code&gt;
    // if category name is blog then do this
    if (is_category(&#039;blog&#039;)){
         include(TEMPLATEPATH.&#039;/theblog.php&#039;); 
    }
	
	
	$cats = wp_list_categories(&#039;child_of=4&amp;echo=0&#039;);
else if(is_category(array($cats)){
include(TEMPLATEPATH.&#039;/theblog.php&#039;); 
}

    else {
        //  all others do this
       include(TEMPLATEPATH.&#039;/all-categories.php&#039;); 
    }

&lt;/code&gt;


Did I mess something up?

thanks again... appreciate the help.</description>
		<content:encoded><![CDATA[<p>Thanks for the reply&#8230; the second one is what I am after but can&#8217;y seem to get it to work. here is my code:</p>
<p><code><br />
    // if category name is blog then do this<br />
    if (is_category('blog')){<br />
         include(TEMPLATEPATH.'/theblog.php');<br />
    }</p>
<p>	$cats = wp_list_categories('child_of=4&amp;echo=0');<br />
else if(is_category(array($cats)){<br />
include(TEMPLATEPATH.'/theblog.php');<br />
}</p>
<p>    else {<br />
        //  all others do this<br />
       include(TEMPLATEPATH.'/all-categories.php');<br />
    }</p>
<p></code></p>
<p>Did I mess something up?</p>
<p>thanks again&#8230; appreciate the help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
