<?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>Alexandru Cosmin &#187; Tutorials</title>
	<atom:link href="http://www.acosmin.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acosmin.com</link>
	<description>Blogging, internet marketing and premium wordpress themes</description>
	<lastBuildDate>Tue, 08 Jun 2010 18:31:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>If Conditional tags for WordPress themes</title>
		<link>http://www.acosmin.com/if-conditional-tags-for-wordpress-themes/</link>
		<comments>http://www.acosmin.com/if-conditional-tags-for-wordpress-themes/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 07:23:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.acosmin.com/if-conditional-tags-for-wordpress-themes/</guid>
		<description><![CDATA[One year ago, I had some ”problems” with a wordpress theme because I wanted a simple thingy and I didn’t know how to do it: [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#300x250post-->
<p>One year ago, I had some ”problems” with a wordpress theme because I wanted a simple thingy and I didn’t know how to do it: make certain stuff (ads, categories, widgets) to appear or disappear depending on the type of page I wanted to add them. This trick is good for placing, rotating ads especially in the header, sidebar and footer, based on conditional tags that are built in wordpress.</p>
<p></p>
<p>The first conditional tag that describes your index or home page is: <strong>is_home()</strong>. I will write you an example shortly but now I let me explain why you should use this. Let’s say you have an ad spot of 728x90px in your header or footer and in that spot you want a certain banner to appear when you are browsing the index page and another banner when you are reading a post or viewing a category page. For this you can place the following php cod in that spot:</p>
<p><span id="more-126"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img src=&quot;bannerad.jpg&quot;/&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p></p>
<p>That was for the index, now for a single post the code looks like this and for a page you just change is_single() with  is_page() </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img src=&quot;bannerad.jpg&quot;/&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p></p>
<p>So the wordpress conditional tags are very easy to use and handy, a bigger list of tags you can see and learn <a href="http://codex.wordpress.org/Conditional_Tags" rel="nofollow">here</a> at codex wordpress! This is just a simple introduction and I hope it helps you</p>
]]></content:encoded>
			<wfw:commentRss>http://www.acosmin.com/if-conditional-tags-for-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
