<?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"
	>
<channel>
	<title>Comments on: Conditional Display of AdSense and other Ads in WordPress - Part II</title>
	<atom:link href="http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/</link>
	<description>Blogging on Software Reviews, Hardware, Downloads, Technology, Search Engines, AdSense, AdWords, Firefox, Windows, HowTo, Tips and Tricks, SEO, programming and web 2.0</description>
	<pubDate>Sun, 12 Oct 2008 00:27:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: curiousman</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-14783</link>
		<dc:creator>curiousman</dc:creator>
		<pubDate>Tue, 09 Sep 2008 01:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-14783</guid>
		<description>I pasted the wrong version. I did remove and in fact, I just double checked and it still failed with the following error message:

Parse error: syntax error, unexpected $end in /home/smsoo1/public_html/wp-content/themes/StudioPress/home.php on line 56


Just to give you an idea what my home.php looks like after inserting this one line,  here's the first few lines of code
















&#60;a href=""&#62;&lt;/a&gt;


 in


</description>
		<content:encoded><![CDATA[<p>I pasted the wrong version. I did remove and in fact, I just double checked and it still failed with the following error message:</p>
<p>Parse error: syntax error, unexpected $end in /home/smsoo1/public_html/wp-content/themes/StudioPress/home.php on line 56</p>
<p>Just to give you an idea what my home.php looks like after inserting this one line,  here&#8217;s the first few lines of code</p>
<p>&lt;a href=&#8221;"&gt;</p>
<p> in</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raj</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-14776</link>
		<dc:creator>Raj</dc:creator>
		<pubDate>Mon, 08 Sep 2008 15:10:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-14776</guid>
		<description>curiousman, there is a space between &lt; and ? at the beginning of that code. You will have to remove the that space.</description>
		<content:encoded><![CDATA[<p>curiousman, there is a space between < and ? at the beginning of that code. You will have to remove the that space.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: curiousman</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-14760</link>
		<dc:creator>curiousman</dc:creator>
		<pubDate>Mon, 08 Sep 2008 07:26:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-14760</guid>
		<description>Hi bloghash, I did exactly what you said but it gave an error (as if the code was not complete -it complained something about unexpected end of file and pointed to the last line of the file). The only difference is I modified home.php instead of index.php because when I inserted the counter into index.php, nothing changed. No ad was shown on the homepage. 

My wordpress version is 2.6.1 if that matters. I even removed the adsense code gradually to the point only the variable declaration was left

&#60; ?php $postnum = 0; if (have_posts()) : ?&#62;


and still it failed. As soon as I removed everything, my website came back to live. What\'s wrong?</description>
		<content:encoded><![CDATA[<p>Hi bloghash, I did exactly what you said but it gave an error (as if the code was not complete -it complained something about unexpected end of file and pointed to the last line of the file). The only difference is I modified home.php instead of index.php because when I inserted the counter into index.php, nothing changed. No ad was shown on the homepage. </p>
<p>My wordpress version is 2.6.1 if that matters. I even removed the adsense code gradually to the point only the variable declaration was left</p>
<p>&lt; ?php $postnum = 0; if (have_posts()) : ?&gt;</p>
<p>and still it failed. As soon as I removed everything, my website came back to live. What\&#8217;s wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raj</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5933</link>
		<dc:creator>Raj</dc:creator>
		<pubDate>Wed, 23 May 2007 16:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5933</guid>
		<description>Hi Nathan,
Thank you visiting my blog and nice to know that the info on this post could be of some assistance to you!
Cheers!</description>
		<content:encoded><![CDATA[<p>Hi Nathan,<br />
Thank you visiting my blog and nice to know that the info on this post could be of some assistance to you!<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nathan</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5932</link>
		<dc:creator>nathan</dc:creator>
		<pubDate>Wed, 23 May 2007 16:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5932</guid>
		<description>Thank you so much - I don't need the AdSense code but I've been wondering for awhile how you'd add info between posts like this.

Great jorb!</description>
		<content:encoded><![CDATA[<p>Thank you so much - I don&#8217;t need the AdSense code but I&#8217;ve been wondering for awhile how you&#8217;d add info between posts like this.</p>
<p>Great jorb!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raj</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5706</link>
		<dc:creator>Raj</dc:creator>
		<pubDate>Thu, 17 May 2007 16:51:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5706</guid>
		<description>Hello Rod,
Nice to know that it worked for you :) and thanks for visiting my blog. 
Cheers!</description>
		<content:encoded><![CDATA[<p>Hello Rod,<br />
Nice to know that it worked for you <img src='http://www.bloghash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> and thanks for visiting my blog.<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rod</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5703</link>
		<dc:creator>Rod</dc:creator>
		<pubDate>Thu, 17 May 2007 15:52:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-5703</guid>
		<description>Thanks for this post.  I've been looking for this information for a fair while and all the other tutorials on how to do it just never seemed to work.  This one, I'm happy to say, worked perfectly.</description>
		<content:encoded><![CDATA[<p>Thanks for this post.  I&#8217;ve been looking for this information for a fair while and all the other tutorials on how to do it just never seemed to work.  This one, I&#8217;m happy to say, worked perfectly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WordPress K2: Google AdSense Under First Post Only &#124; davemorg.org</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-2907</link>
		<dc:creator>WordPress K2: Google AdSense Under First Post Only &#124; davemorg.org</dc:creator>
		<pubDate>Fri, 23 Mar 2007 22:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-2907</guid>
		<description>[...] AdSense block under only the first post on a Wordpress installation. While I found a good deal of information, I couldn&#8217;t find very much of anything that applied specifically to the popular K2 [...]</description>
		<content:encoded><![CDATA[<p>[...] AdSense block under only the first post on a Wordpress installation. While I found a good deal of information, I couldn&#8217;t find very much of anything that applied specifically to the popular K2 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HowTO: Place Ad Unit in Your Blog-Part II - Enblogopedia.com</title>
		<link>http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-291</link>
		<dc:creator>HowTO: Place Ad Unit in Your Blog-Part II - Enblogopedia.com</dc:creator>
		<pubDate>Sat, 23 Dec 2006 17:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloghash.com/2006/11/conditional-display-of-adsense-and-other-ads-in-wordpress-part-ii/#comment-291</guid>
		<description>[...] P.S. Tips above may not be correct in some cases, since it depends on the design of your blog!  How Can I Put Ad Units Between Posts? The answer of this question is easy..and Raj posted a nice tutorial called &#8220;Conditional Display of AdSense and other Ads in WordPress&#8221; about it. Honestly I had some problems following his tutorial. Anyway, this is my code: As in Raj tutorial you create a counter and set it to zero before the loop start, then the counter should increment by 1 whenever one loop ends &#60;?php $postnum = 0; if (have_posts()) : while (have_posts()) : $postnum = $postnum + 1; the_post(); ?&#62; and since I don&#8217;t have a Single page template the condition and the code will look like &#60;?php if (2 == $postnum &#38;&#38; !is_single()) { ?&#62; &#60;br/&#62;YOUR Ad Unit Code or Adsense Deluxe PHP command goes here! &#60;?php } ?&#62; As you can see here the Ad unit will appear after the second post. [...]</description>
		<content:encoded><![CDATA[<p>[...] P.S. Tips above may not be correct in some cases, since it depends on the design of your blog!  How Can I Put Ad Units Between Posts? The answer of this question is easy..and Raj posted a nice tutorial called &#8220;Conditional Display of AdSense and other Ads in WordPress&#8221; about it. Honestly I had some problems following his tutorial. Anyway, this is my code: As in Raj tutorial you create a counter and set it to zero before the loop start, then the counter should increment by 1 whenever one loop ends &lt;?php $postnum = 0; if (have_posts()) : while (have_posts()) : $postnum = $postnum + 1; the_post(); ?&gt; and since I don&#8217;t have a Single page template the condition and the code will look like &lt;?php if (2 == $postnum &amp;&amp; !is_single()) { ?&gt; &lt;br/&gt;YOUR Ad Unit Code or Adsense Deluxe PHP command goes here! &lt;?php } ?&gt; As you can see here the Ad unit will appear after the second post. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
