<?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>WordPress tips &#8211; CodePills.com</title>
	<atom:link href="https://codepills.com/tag/wordpress-tips/feed/" rel="self" type="application/rss+xml" />
	<link>https://codepills.com</link>
	<description>Helping you make a better code</description>
	<lastBuildDate>Fri, 07 Jun 2013 15:00:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>WordPress image targeting</title>
		<link>https://codepills.com/wordpress-image-targeting-2/</link>
					<comments>https://codepills.com/wordpress-image-targeting-2/#respond</comments>
		
		<dc:creator><![CDATA[Andrej Buday]]></dc:creator>
		<pubDate>Fri, 07 Jun 2013 15:00:08 +0000</pubDate>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[WordPress tips]]></category>
		<guid isPermaLink="false">http://codekopf.com/?p=672</guid>

					<description><![CDATA[This is a small code tip for WordPress templating which helps better target images in WordPress templates. Code lines are easy to remove or add, based on request. Targeting is secured by WordPress PHP slug is_home, is_single, is_page, is_archive, is_page. &#8230; <a href="https://codepills.com/wordpress-image-targeting-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This is a small code tip for WordPress templating which helps better target images in WordPress templates.<br />
<span id="more-672"></span><br />
Code lines are easy to remove or add, based on request. Targeting is secured by WordPress PHP slug is_home, is_single, is_page, is_archive, is_page.</p>
<pre class="lang:php decode:true">&lt;?php if (is_home()) { ?&gt;
&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/img/home_dogs.jpg" &gt;
&lt;?php } elseif (is_single()) { ?&gt;
&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/img/single_dogs.jpg" &gt;
&lt;?php } elseif (is_page()) { ?&gt;
&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/img/default_famous_dogs.jpg" &gt;
&lt;?php } elseif (is_archive()) { ?&gt;
&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/img/archive_dogs.jpg" &gt;

// Targeting on certain page, based on its slug.
&lt;?php } elseif (is_page('dog-lessie')) { ?&gt;
&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/img/lessie.jpg" &gt;
&lt;?php } elseif (is_page('dog-laika')) { ?&gt;
&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/img/laika.jpg" &gt;

// Default picture
&lt;?php } else { ?&gt;
&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/img/default.jpg" &gt;
&lt;?php } ?&gt;</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://codepills.com/wordpress-image-targeting-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
