<?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>Jigsaw Boys &#187; adsense</title>
	<atom:link href="http://www.jigsawboys.com/tag/adsense/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jigsawboys.com</link>
	<description>Security, Network and Computer Tech Tip Database!</description>
	<lastBuildDate>Tue, 07 Sep 2010 02:43:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Adsense inline your WordPress Blog posts</title>
		<link>http://www.jigsawboys.com/2006/03/07/adsense-inline-your-wordpress-blog-posts/</link>
		<comments>http://www.jigsawboys.com/2006/03/07/adsense-inline-your-wordpress-blog-posts/#comments</comments>
		<pubDate>Mon, 06 Mar 2006 22:50:05 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[adsense]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/2006/03/07/adsense-inline-your-wordpress-blog-posts/</guid>
		<description><![CDATA[I stumbled upon this very handy guide on how to insert an adsense ad unit after the first post on your wordpress blog. To do this you will need to be able to edit the template files, specifically the &#8220;index.php&#8221; file. The guide uses a simple PHP if statement to count the number of posts [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon this very handy guide on how to insert an adsense ad unit after the first post on your wordpress blog.</p>
<p>To do this you will need to be able to edit the template files, specifically the &#8220;index.php&#8221; file.<br />
The guide uses a simple PHP if statement to count the number of posts and insert the adsense code after the first post (or second or third etc).</p>
<p>Open up the template file <strong>index.php</strong> in your favourite text editor and add this to the top.</p>
<pre lang="php" line="1">
<?php
$postnum = 1;
$showadsense1 = 1;
?>
</pre>
<p>In the index file there is a &#8220;while&#8221; loop that grabs all the needed wordpress posts.<br />
It starts with this</p>
<pre lang="html4strict" line="1">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?></pre>
<p>and ends with</p>
<pre lang="html4strict" line="1"><?php endwhile; ?></pre>
<p>Just before this &#8220;endwhile&#8221; statement, we need to add some code.</p>
<pre lang="html4strict" line="1">
<?php
	if ($postnum == $showadsense1) {
		echo 'Your adsense code goes here';
	}
$postnum++;
?>
</pre>
<p>And your done!</p>
<p><a href="http://www.tamba2.org.uk/wordpress/adsense/">Read more</a> about tips on adding Adsense to your blog.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2006/03/07/adsense-inline-your-wordpress-blog-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
