<?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: How to Use WordPress Conditional Statements</title>
	<atom:link href="http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 28 Dec 2011 20:34:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: davej friesen</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-3383</link>
		<dc:creator>davej friesen</dc:creator>
		<pubDate>Sun, 12 Dec 2010 07:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-3383</guid>
		<description>jonah...
from what you are saying it looks like you could achieve what you want by using several is_category( &#039;somecat&#039; ) statements instead of a million is_page( &#039;somepage&#039; )s...what you have written, basically: is_page( &quot;find the current page&quot; ) will always return true for every page...its just a processor intensive version of an empty is_page() 

if you are after a current page/menu class, the &lt;a href=&quot;http://wordpress.org/&quot; rel=&quot;nofollow&quot;&gt;wordpress 3.0&lt;/a&gt; custom menu feature automatically adds classes for the current page on the fly, and a few for the parents and ancestors...check out the &lt;a href=&quot;http://project77.org/2010/twentyten5-theme-html5-boilerplate-meets-twentyten-for-wordpress/&quot; rel=&quot;nofollow&quot;&gt;twentyten&lt;/a&gt; theme and look in the css for these badboys:

current_page_item

current-menu-item

...great intro article, hirsch, takes away some of the pain and trepidation of finding all the pieces in the codex&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>jonah&#8230;<br />
from what you are saying it looks like you could achieve what you want by using several is_category( &#8216;somecat&#8217; ) statements instead of a million is_page( &#8216;somepage&#8217; )s&#8230;what you have written, basically: is_page( &#8220;find the current page&#8221; ) will always return true for every page&#8230;its just a processor intensive version of an empty is_page() </p>
<p>if you are after a current page/menu class, the <a href="http://wordpress.org/" rel="nofollow">wordpress 3.0</a> custom menu feature automatically adds classes for the current page on the fly, and a few for the parents and ancestors&#8230;check out the <a href="http://project77.org/2010/twentyten5-theme-html5-boilerplate-meets-twentyten-for-wordpress/" rel="nofollow">twentyten</a> theme and look in the css for these badboys:</p>
<p>current_page_item</p>
<p>current-menu-item</p>
<p>&#8230;great intro article, hirsch, takes away some of the pain and trepidation of finding all the pieces in the codex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonah</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-3246</link>
		<dc:creator>Jonah</dc:creator>
		<pubDate>Fri, 26 Nov 2010 23:11:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-3246</guid>
		<description>Question: Is there a way to do a if (is_page(&#039;wp_title&#039;)) or something like that? So it dynamically reads the page title and inserts it into the code so I don&#039;t have to make a million if else statements for a given category?

Basically I am trying to insert an active class in a custom generated menu, and I have tried a number of things without success. Any thoughts would be appreciated.</description>
		<content:encoded><![CDATA[<p>Question: Is there a way to do a if (is_page(&#8216;wp_title&#8217;)) or something like that? So it dynamically reads the page title and inserts it into the code so I don&#8217;t have to make a million if else statements for a given category?</p>
<p>Basically I am trying to insert an active class in a custom generated menu, and I have tried a number of things without success. Any thoughts would be appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Code Moi Ca</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2555</link>
		<dc:creator>Code Moi Ca</dc:creator>
		<pubDate>Mon, 18 Jan 2010 18:48:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2555</guid>
		<description>Oh this article is great it sent me on the right track. All I wanted to do was display an ad on single posts and in my archive page! Cheers.</description>
		<content:encoded><![CDATA[<p>Oh this article is great it sent me on the right track. All I wanted to do was display an ad on single posts and in my archive page! Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bookmarks for October 31st</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2147</link>
		<dc:creator>Bookmarks for October 31st</dc:creator>
		<pubDate>Sun, 01 Nov 2009 09:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2147</guid>
		<description>[...] How to Use Wordpress Conditional Statements &#8211; How To&#8217;s Article by Addicott Web, Chicago ... &#8211; [...]</description>
		<content:encoded><![CDATA[<p>[...] How to Use WordPress Conditional Statements &#8211; How To&#8217;s Article by Addicott Web, Chicago &#8230; &#8211; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ares</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2125</link>
		<dc:creator>Ares</dc:creator>
		<pubDate>Thu, 29 Oct 2009 07:30:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2125</guid>
		<description>In example #5 you don&#039;t actually need the parenthesis for the negation. You are just adding &quot;more&quot; work to the parser.

So it could be rewritten as follows:

post_parent==&quot;Fruits&quot; &amp;&amp; !is_page(&#039;Bananas&#039;)  ) { ?&gt;...</description>
		<content:encoded><![CDATA[<p>In example #5 you don&#8217;t actually need the parenthesis for the negation. You are just adding &#8220;more&#8221; work to the parser.</p>
<p>So it could be rewritten as follows:</p>
<p>post_parent==&#8221;Fruits&#8221; &amp;&amp; !is_page(&#8216;Bananas&#8217;)  ) { ?&gt;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2116</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Wed, 28 Oct 2009 13:06:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2116</guid>
		<description>Very useful article for someone just trying to delve into PHP.

I just need to find a GOOD way to translate IP Address into Country Code, and then I plan to use this to display country specific information to visitors, in particular advert blocks.</description>
		<content:encoded><![CDATA[<p>Very useful article for someone just trying to delve into PHP.</p>
<p>I just need to find a GOOD way to translate IP Address into Country Code, and then I plan to use this to display country specific information to visitors, in particular advert blocks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WordPress Picks for the week [10/25] &#124; Techtites</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2070</link>
		<dc:creator>WordPress Picks for the week [10/25] &#124; Techtites</dc:creator>
		<pubDate>Sun, 25 Oct 2009 14:20:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2070</guid>
		<description>[...] How to Use Wordpress Conditional Statements [...]</description>
		<content:encoded><![CDATA[<p>[...] How to Use WordPress Conditional Statements [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kim Doyal</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2063</link>
		<dc:creator>Kim Doyal</dc:creator>
		<pubDate>Fri, 23 Oct 2009 18:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2063</guid>
		<description>Thanks for this!
I&#039;ve been working with WordPress for a while and am now digging deeper into the code side of things (who knew it was kind of fun? :-) ).
Tweeted &amp; stumbled this....
Thanks,
Kim Doyal
The WordPress Chick</description>
		<content:encoded><![CDATA[<p>Thanks for this!<br />
I&#8217;ve been working with WordPress for a while and am now digging deeper into the code side of things (who knew it was kind of fun? <img src='http://www.addicottweb.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).<br />
Tweeted &amp; stumbled this&#8230;.<br />
Thanks,<br />
Kim Doyal<br />
The WordPress Chick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2062</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 23 Oct 2009 16:08:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2062</guid>
		<description>Thanks for the first example - I couldn&#039;t remember how to do the else statement so I had been using multiple single conditional statements for each are (page, archive, single, home, etc.)  Allowed me to clean up about 15+ lines of code into 5.</description>
		<content:encoded><![CDATA[<p>Thanks for the first example &#8211; I couldn&#8217;t remember how to do the else statement so I had been using multiple single conditional statements for each are (page, archive, single, home, etc.)  Allowed me to clean up about 15+ lines of code into 5.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Addicott Web</title>
		<link>http://www.addicottweb.com/2009/10/how-to-use-wordpress-conditional-statements/#comment-2060</link>
		<dc:creator>Addicott Web</dc:creator>
		<pubDate>Fri, 23 Oct 2009 13:23:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.addicottweb.com/?p=2345#comment-2060</guid>
		<description>What I was trying to show is that you can apply the same thing to two different pages. On second glance though, the way I wrote it wouldn&#039;t do that - I would need the &quot;&#124;&#124;” instead. I&#039;ll update it so now one else gets the wrong impression about it!</description>
		<content:encoded><![CDATA[<p>What I was trying to show is that you can apply the same thing to two different pages. On second glance though, the way I wrote it wouldn&#8217;t do that &#8211; I would need the &#8220;||” instead. I&#8217;ll update it so now one else gets the wrong impression about it!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

