<?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>HandymanHowto.com &#187; source code</title>
	<atom:link href="http://www.handymanhowto.com/tag/source-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.handymanhowto.com</link>
	<description>Home improvement, maintenance and repair projects.</description>
	<lastBuildDate>Sun, 25 Jul 2010 12:27:45 +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>How to Display Adsense Ads in the WordPress Index Pages for Fresh News by WooThemes &#8211; Part 2</title>
		<link>http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2/</link>
		<comments>http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 00:31:33 +0000</pubDate>
		<dc:creator>Bob Jackson</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[250x250 image ad]]></category>
		<category><![CDATA[960.css]]></category>
		<category><![CDATA[adsense in post index pages]]></category>
		<category><![CDATA[adsense on front page]]></category>
		<category><![CDATA[adsense unit]]></category>
		<category><![CDATA[Banner Ad integration]]></category>
		<category><![CDATA[cascading style sheet]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[custom adsense widget]]></category>
		<category><![CDATA[custom development]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[Fresh News Theme]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[how add adsense to the front page]]></category>
		<category><![CDATA[how to increase adsense revenue]]></category>
		<category><![CDATA[How to integrate Adsense with Fresh News by WooThemes]]></category>
		<category><![CDATA[how to integrate adsense with Wordpress]]></category>
		<category><![CDATA[How to monetize your Wordpress blog]]></category>
		<category><![CDATA[image ads]]></category>
		<category><![CDATA[index.php]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[main index template]]></category>
		<category><![CDATA[make money]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[publisher id]]></category>
		<category><![CDATA[sample code]]></category>
		<category><![CDATA[sidebar ad]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[step by step]]></category>
		<category><![CDATA[style sheet]]></category>
		<category><![CDATA[style.css]]></category>
		<category><![CDATA[Theme Editor]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress theme customization with adsense]]></category>

		<guid isPermaLink="false">http://www.handymanhowto.com/?p=3407</guid>
		<description><![CDATA[This tutorial is continued from Part 1. Summary of Code Changes to index.php The index.php file is the theme template that displays the Featured Posts and Post Summaries (Excerpts) to paint the body of the Front Page and Index Pages. Source code logic is added to index.php to display the Google Adsense Ads at the [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is continued from <a title="How to Display Adsense Ads in the WordPress Index Pages for Fresh News by WooThemes – Part 1" href="http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1/" target="_blank">Part 1</a>.</p>
<h3>Summary of Code Changes to index.php</h3>
<p>The <strong>index.php</strong> file is the theme template that displays the Featured Posts and Post Summaries (Excerpts) to paint the body of the <strong>Front Page</strong> and <strong>Index Pages</strong>. Source code logic is added to index.php to display the Google Adsense Ads at the appropriate position in the summaries and <strong>only once per page</strong> to stay within the maximum of 3 ads per web page.</p>
<p>First, a new variable is created to ensure the Adsense Ads are display only once per page at line 27:</p>
<pre class="brush: php; first-line: 27;">
&lt;?php $BannerAdsDisplayed = FALSE; ?&gt; &lt;!-- Boolean to show featured banner ads only once. --&gt;
</pre>
<p><span id="more-3407"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>The main code for the <strong>Featured Banner Ads</strong> &#8211; this is how I described the new feature in the php  comments &#8211; is on lines 61 to 99:</p>
<pre class="brush: php; first-line: 61;">
           &lt;!-- Featured Banner Ads 250px x 250px --&gt;
           &lt;?php if (($BannerAdsDisplayed == FALSE &amp;amp;&amp;amp; !$is_paged) || /* show on main page after featured posts */
                     ($is_paged &amp;amp;&amp;amp; $postcount == 3)) /* show after the 3rd post on index pages 2 and greater */
           { ?&gt;
           &lt;?php   $BannerAdsDisplayed = TRUE; ?&gt;
              &lt;div class=&amp;quot;box&amp;quot;&gt;
                 &lt;div id=&amp;quot;featured_ads&amp;quot;&gt;
                    &lt;div id=&amp;quot;banner_ad_left&amp;quot;&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;&gt;&lt;!--
                           google_ad_client = &amp;quot;pub-2484226848394294&amp;quot;;
                           /* 250x250, created 6/10/08 */
                           google_ad_slot = &amp;quot;8646292631&amp;quot;;
                           google_ad_width = 250;
                           google_ad_height = 250;
                           //--&gt;
                       &lt;/script&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;
                           src=&amp;quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&amp;quot;&gt;
                       &lt;/script&gt;
                    &lt;/div&gt;
                    &lt;div id=&amp;quot;banner_ad_right&amp;quot;&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;&gt;&lt;!--
                           google_ad_client = &amp;quot;pub-2484226848394294&amp;quot;;
                           /* 250x250, created 6/10/08 */
                           google_ad_slot = &amp;quot;8646292631&amp;quot;;
                           google_ad_width = 250;
                           google_ad_height = 250;
                           //--&gt;
                       &lt;/script&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;
                           src=&amp;quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&amp;quot;&gt;
                       &lt;/script&gt;
                    &lt;/div&gt;
                 &lt;/div&gt; &lt;!-- featured ads --&gt;
              &lt;/div&gt; &lt;!--/box --&gt;
           &lt;?php
           } ?&gt;	&lt;!-- if($BannerAdsDisplayed...) --&gt;

           &lt;!-- Featured Banner Ads Ends --&gt;
</pre>
<h4>Disable the Post Date Display</h4>
<p>I&#8217;ve disabled the post date display on all my posts <strong>purely as a matter of personal preference </strong>- see lines 38 to 42 and 106 to 110. If you want the post date to be shown as usual, simply <strong>uncomment these lines</strong>. Either way, this <strong>change is unrelated</strong> to the  Google Adsense enhancements and has no impact on the Ad display logic.</p>
<pre class="brush: php; first-line: 38;">
&lt;?php
/************* suppress the date display on posts
&lt;p class=&amp;quot;fl&amp;quot;&gt;&lt;?php the_time('j. F Y'); ?&gt;&lt;/p&gt;
*/
?&gt;
</pre>
<p>and</p>
<pre class="brush: php; first-line: 106;">
&lt;?php
/************* suppress the date display on posts
&lt;p class=&amp;quot;fl&amp;quot;&gt;&lt;?php the_time('j. F Y'); ?&gt;&lt;/p&gt;
*/
?&gt;
</pre>
<p>Now let&#8217;s make the changes to index.php.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h3>Edit index.php</h3>
<p>If you haven&#8217;t already made a backup of your WordPress database, <strong>please do so now.</strong> If you make an error in the edits to index.php it can possibly make your blog unreadable.</p>
<p>The following instructions assumes you&#8217;ve not made any customizations to index.php and you&#8217;re using Fresh News v2.0.7. If you&#8217;re using a different version or have made other customizations, you&#8217;ll need to &#8220;stare and compare&#8221; and merge the Adsense code enhancements using your judgment.</p>
<ul>
<li>Log in to your WordPress Admin Panel.</li>
<li>Open the Theme Editor at <strong>Appearance</strong> → <strong>Editor</strong> in the left navigation menu.</li>
<li>Open the Main Index Template file <strong>index.php</strong> by clicking on it in the right menu.</li>
<li>Right click in the editor and choose <strong>Select All</strong>.</li>
<li>Right click and choose <strong>Cut</strong>. The content of the Theme Editor is now <strong>empty</strong>.</li>
<li>Open Notepad or your favorite text editor and paste the contents of index.php into notepad. Now <span style="text-decoration: underline;">save this original copy</span> of index.php to your local computer <span style="text-decoration: underline;">just in case you need to recover the original version</span> (this will be quicker than restoring the site backup.) Alternately, use File Manager in cPanel and/or save a copy using FTP.</li>
</ul>
<div id="attachment_3424" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/09/Main-Index-Template-Theme-Editor.png"><img class="size-medium wp-image-3424" title="Theme Editor - Main Index Template: index.php " src="http://www.handymanhowto.com/wp-content/uploads/2009/09/Main-Index-Template-Theme-Editor-450x241.png" alt="Theme Editor - Main Index Template: index.php " width="450" height="241" /></a><p class="wp-caption-text">Theme Editor - Main Index Template: index.php </p></div>
<ul>
<li><strong><span style="color: #ff0000;">The full source code for the Adsense enhancements is here:</span></strong> <a href="http://www.handymanhowto.com/wp-content/uploads/2009/09/index_php.txt">index.php</a></li>
<li>Paste the upgraded index.php code into the Theme Editor.</li>
<li>Replace my Adsense 250&#215;250 code unit with <strong>your Adsense code</strong> on lines 69 to 79 and 82 to 92 as highlighted:</li>
</ul>
<pre class="brush: php; first-line: 65; highlight: [69,70,71,72,73,74,75,76,77,78,79,82,83,84,85,86,87,88,89,90,91,92];">
           &lt;?php   $BannerAdsDisplayed = TRUE; ?&gt;
              &lt;div class=&amp;quot;box&amp;quot;&gt;
                 &lt;div id=&amp;quot;featured_ads&amp;quot;&gt;
                    &lt;div id=&amp;quot;banner_ad_left&amp;quot;&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;&gt;&lt;!--
                           google_ad_client = &amp;quot;pub-2484226848394294&amp;quot;;
                           /* 250x250, created 6/10/08 */
                           google_ad_slot = &amp;quot;8646292631&amp;quot;;
                           google_ad_width = 250;
                           google_ad_height = 250;
                           //--&gt;
                       &lt;/script&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;
                           src=&amp;quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&amp;quot;&gt;
                       &lt;/script&gt;
                    &lt;/div&gt;
                    &lt;div id=&amp;quot;banner_ad_right&amp;quot;&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;&gt;&lt;!--
                           google_ad_client = &amp;quot;pub-2484226848394294&amp;quot;;
                           /* 250x250, created 6/10/08 */
                           google_ad_slot = &amp;quot;8646292631&amp;quot;;
                           google_ad_width = 250;
                           google_ad_height = 250;
                           //--&gt;
                       &lt;/script&gt;
                       &lt;script type=&amp;quot;text/javascript&amp;quot;
                           src=&amp;quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&amp;quot;&gt;
                       &lt;/script&gt;
                    &lt;/div&gt;
                 &lt;/div&gt; &lt;!-- featured ads --&gt;
              &lt;/div&gt; &lt;!--/box --&gt;
</pre>
<ul>
<li>Click &#8220;Update File&#8221; to save.</li>
</ul>
<h3>Test the Adsense Upgrade to Front Page and Index Pages</h3>
<p>In a new web browser window, open your web site and confirm the two Google Adsense Ads are displayed after the Featured Posts on the Front Page, and after the 2nd post summary on the following Index Pages.</p>
<p>If something doesn&#8217;t look right, just paste the original source code back into index.php and save to restore the original look and feel.</p>
<h3>Track the Performance of the new 250&#215;250 Page Ads</h3>
<p>If you&#8217;re interested to know how well the new Adsense Ads are performing, log in to your Adsense Account and create a <a title="Adsense Custom Channels" href="https://www.google.com/adsense/support/bin/answer.py?answer=9869" target="_blank">custom channel</a> to track the performance of the new ad units.</p>
<p>Hope this helps,</p>
<p>Bob Jackson</p>
<p></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It!</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F" rel="nofollow" title="Add to&nbsp;Squidoo"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/squidoo.png" title="Add to&nbsp;Squidoo" alt="Add to&nbsp;Squidoo" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2%2F&amp;t=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Display Adsense Ads in the WordPress Index Pages for Fresh News by WooThemes &#8211; Part 1</title>
		<link>http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1/</link>
		<comments>http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 00:22:25 +0000</pubDate>
		<dc:creator>Bob Jackson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[960.css]]></category>
		<category><![CDATA[adsense in post index pages]]></category>
		<category><![CDATA[adsense on front page]]></category>
		<category><![CDATA[adsense unit]]></category>
		<category><![CDATA[Banner Ad integration]]></category>
		<category><![CDATA[cascading style sheet]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[custom adsense widget]]></category>
		<category><![CDATA[custom development]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[Fresh News Theme]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[how add adsense to the front page]]></category>
		<category><![CDATA[how to increase adsense revenue]]></category>
		<category><![CDATA[How to integrate Adsense with Fresh News by WooThemes]]></category>
		<category><![CDATA[how to integrate adsense with Wordpress]]></category>
		<category><![CDATA[How to monetize your Wordpress blog]]></category>
		<category><![CDATA[image ads]]></category>
		<category><![CDATA[index.php]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[main index template]]></category>
		<category><![CDATA[make money]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[publisher id]]></category>
		<category><![CDATA[sidebar ad]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[step by step]]></category>
		<category><![CDATA[style sheet]]></category>
		<category><![CDATA[style.css]]></category>
		<category><![CDATA[Theme Editor]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress theme customization with adsense]]></category>

		<guid isPermaLink="false">http://www.handymanhowto.com/?p=3371</guid>
		<description><![CDATA[This tutorial explains how to display Google Adsense Ads in your WordPress post index pages to generate revenue from this prime area of web page real estate. Revenue Opportunity for Front- and Index Page Ads I use the Fresh News 2.0.7 theme by WooThemes for the primary look and feel of www.handymanhowto.com and wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial explains how to display Google Adsense Ads in your WordPress post index pages to generate revenue from this prime area of web page real estate.</p>
<h3>Revenue Opportunity for Front- and Index Page Ads</h3>
<p>I use the <a title="Fresh News theme by WooThemes, Inc." href="http://www.woothemes.com/2008/04/fresh-news/" target="_blank">Fresh News 2.0.7 theme</a> by <a title="WordPress themes for all types of publishers." href="http://www.woothemes.com/" target="_blank">WooThemes</a> for the primary look and feel of <a title="Home Improvement Projects, Advice and Technology" href="www.handymanhowto.com" target="_blank">www.handymanhowto.com</a> and wanted to display the maximum allowed three (3) Google Adsense Ads on all my pages and articles, including the Front Page and Index Pages. All pages have a 300&#215;250 Adsense ad in the sidebar which counts as one (1) Adsense Ad per web page. Individual articles (or single posts) contain two (2) additional Adsense Ads in the post body bringing the total number of ads for a single post web page to the maximum of 3 allowed by Google.</p>
<p><span id="more-3371"></span><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>The problem is the Front Page  and post Index Pages did not contain Google Ads in the page body because there was no plug-n-play or widget-based method in the Fresh News theme to include the Adsense code, leaving these frequently viewed pages with only the single ad in the sidebar. I was missing a revenue opportunity to display two additional ads on prime web page real estate.</p>
<p>The next image illustrates the solution with two 250&#215;250 Adsense Ads displayed immediately after the Featured Posts for a total of three (3) Google ads on the Front Page.</p>
<div id="attachment_3377" class="wp-caption alignnone" style="width: 444px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/09/Main-Page.png"><img class="size-medium wp-image-3377" title="Google Adsense Ads in the WordPress Page Index for Fresh News" src="http://www.handymanhowto.com/wp-content/uploads/2009/09/Main-Page-434x600.png" alt="Google Adsense Ads in the WordPress Page Index for Fresh News" width="434" height="600" /></a><p class="wp-caption-text">Google Adsense Ads in the WordPress Page Index for Fresh News</p></div>
<p>Ads are displayed after the 2nd blog post on Index Pages for a total of three (3) Google ads per page as allowed by the Adsense program rules:</p>
<div id="attachment_3376" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/09/Index-Pages.png"><img class="size-medium wp-image-3376" title="Google Adsense within Index Pages for Fresh News" src="http://www.handymanhowto.com/wp-content/uploads/2009/09/Index-Pages-450x488.png" alt="Google Adsense within Index Pages for Fresh News" width="450" height="488" /></a><p class="wp-caption-text">Google Adsense within Index Pages for Fresh News</p></div>
<p>Single post pages are unchanged by the Front Page and Index Page modifications.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h2>Fresh News Theme Modifications for Google Adsense Ads</h2>
<p>Before you begin, <span style="text-decoration: underline;">make a backup of your WordPress site</span> because changes will be made to the Fresh News Theme source code files.</p>
<h3>Step 1: Create a 250&#215;250 pixel Google Banner Ad</h3>
<ul>
<li>Log in to your Google Adsense Account at <a title="Google Adsense" href="http://adsense.google.com" target="_blank">http://adsense.google.com</a>.</li>
<li>Go to Adsense for Content and create a square 250&#215;250 Image Ad.</li>
<li>Copy the Adsense Unit Code and save it a local file for later.</li>
</ul>
<p>Here&#8217;s the Adsense code for my 250&#215;250 image ad. Note that your publisher id will be different.</p>
<pre class="brush: php;">&lt;script type=&quot;text/javascript&quot;&gt;&lt;!-- google_ad_client =&quot;pub-2484226848394294&quot;;
/* 250x250, created 6/10/08 */
google_ad_slot = &quot;8646292631&quot;;
google_ad_width = 250;
google_ad_height = 250; //--&gt;
&lt;/script&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;</pre>
<h3>Step 2: Edit your Cascading Style Sheet file:  style.css</h3>
<p>New stylesheet properties are created to properly position the two Adsense ads. The center column is 580 pixels wide as found in the 960.css file: property .grid_10{width:580px}.container_16. (<a title="Firebug web development tool" href="http://getfirebug.com/" target="_blank">Firebug</a> is indispensable for web page is forensics and analysis.) Careful measuring and testing finds that the Featured Post post excerpt div element is 542 pixels wide after allowing for margins. The style sheet pushes one ad to the left (float:left) and one to the right (float:right) of the 542 pixel wide x 270 pixel tall container.</p>
<p>To make the changes to style.css:</p>
<ul>
<li>Log in to your WordPress Admin Panel.</li>
<li>Open the Theme Editor at <strong>Appearance</strong> → <strong>Editor</strong> in the left navigation menu.</li>
<li>Open the Stylesheet file <strong>styles.css</strong> &#8211; it will be near the bottom of the right menu.</li>
<li>Add the following lines of CSS code to the bottom of the file for the Google Ads.</li>
</ul>
<pre class="brush: css;">/*==============  Featured Post Banner Ads  ===================*/
#featured_ads {
       width: 542px;
        height: 270px;
       overflow: hidden;
}

#featured_ads #banner_ad_left {
        float: left;
        width: 250px;
       margin: 10px;
}

#featured_ads #banner_ad_right {
        float: right;
        width: 250px;
        margin: 10px;
}</pre>
<p>The new CSS lines are highlighted in this image:</p>
<div id="attachment_3394" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/09/Edit-style_css.png"><img class="size-medium wp-image-3394" title="Edit the Fresh News Style Sheet - style.css" src="http://www.handymanhowto.com/wp-content/uploads/2009/09/Edit-style_css-450x240.png" alt="Edit the Fresh News Style Sheet - style.css" width="450" height="240" /></a><p class="wp-caption-text">Edit the Fresh News Style Sheet - style.css</p></div>
<ul>
<li>Click &#8220;Update File&#8221; to save your changes.</li>
</ul>
<p>Here&#8217;s the CSS code snippet for the Adsense style additions: <a href="http://www.handymanhowto.com/wp-content/uploads/2009/09/style_css_ad_enhancements.txt">style.css Adsense enhancements</a></p>
<p>This tutorial is continued in <a title="How to Display Adsense Ads in the WordPress Index Pages for Fresh News by WooThemes – Part 2" href="http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-2/" target="_blank">Part 2</a>.</p>
<p>Take care,</p>
<p>Bob Jackson</p>
<p></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It!</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F&amp;title=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F" rel="nofollow" title="Add to&nbsp;Squidoo"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/squidoo.png" title="Add to&nbsp;Squidoo" alt="Add to&nbsp;Squidoo" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F20%2Fhow-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1%2F&amp;t=How+to+Display+Adsense+Ads+in+the+WordPress+Index+Pages+for+Fresh+News+by+WooThemes+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.handymanhowto.com/2009/09/20/how-to-display-adsense-ads-in-the-wordpress-index-pages-for-fresh-news-by-woothemes-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Custom Search Integration with WooThemes Fresh News 2.0 &#8211; Part 2</title>
		<link>http://www.handymanhowto.com/2009/09/13/google-custom-search-integration-with-woothemes-fresh-news-2-0-part-2/</link>
		<comments>http://www.handymanhowto.com/2009/09/13/google-custom-search-integration-with-woothemes-fresh-news-2-0-part-2/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 17:42:34 +0000</pubDate>
		<dc:creator>Bob Jackson</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[fresh news]]></category>
		<category><![CDATA[google cse]]></category>
		<category><![CDATA[google custom search engine]]></category>
		<category><![CDATA[header.php]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[how to integrate google custom search with wordpress]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[make money]]></category>
		<category><![CDATA[page template]]></category>
		<category><![CDATA[page.php]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[search.php]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[woothemes]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.handymanhowto.com/?p=3308</guid>
		<description><![CDATA[This tutorial is continued from Part 1. Create a Search Results Page Template A new WordPress page template is created to display the Google Custom Search Results. The standard page.php template is formatted with a center column to display the page content that&#8217;s designed for a sidebar; and therefore too narrow for the 600 pixel [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is continued from <a title="Google Custom Search Integration with WooThemes Fresh News 2.0 - Part 1" href="http://www.handymanhowto.com/2009/01/03/google-custom-search-integration-with-woo-themes-freshnews/" target="_blank">Part 1</a>.</p>
<h3>Create a Search Results Page Template</h3>
<p>A new <a title="WordPress Page Templates" href="http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates" target="_blank">WordPress page template</a> is created to display the Google Custom Search Results. The standard page.php template is formatted with a center column to display the page content that&#8217;s designed for a sidebar; and therefore <strong>too narrow</strong> for the 600 pixel wide Google search results. Therefore, a new search results page template is created to display the full screen width.</p>
<p>Before you begin, <span style="color: #ff0000;">make a full backup of your WordPress site<span style="color: #000000;"> &#8230; just in case. </span></span></p>
<p><span id="more-3308"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h4>Step 1: Copy the <span style="color: #800000;">page.php</span> template file to make a new <span style="color: #800000;">search.php</span> file</h4>
<ul>
<li>This creates a search results page template.</li>
<li>Use File Manager in cPanel to copy and rename the file.</li>
<li>Place the search.php file in the <strong>/public_html/wp-content/themes/freshnews</strong> directory with the other page templates (e.g. header.php, footer.php, etc).</li>
</ul>
<h4>Step 2: Edit search.php file</h4>
<p>Log in as the Site Admin to your WordPress blog.</p>
<p>Use the Theme Editor in the WordPress Admin Panel to edit the search.php Template File as shown in the following image.</p>
<ul>
<li>Add a Template Name Comment at the top, call it &#8216;Search Results&#8217;</li>
<li>Comment out the centercol div element</li>
<li>Delete the call to get_sidebar()</li>
<li>When done, click Update File in the Theme Editor to save the changes.</li>
</ul>
<div id="attachment_3295" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/search-template-php.png"><img class="size-medium wp-image-3295  " title="Edits to search.php page template" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/search-template-php-450x332.png" alt="Edits to search.php page template" width="450" height="332" /></a><p class="wp-caption-text">Edits to search.php page template</p></div>
<p>The edits are generic and you should be able to reuse my search.php page template without modifications. You can get my file here: <a title="search.php page template file" href="http://www.handymanhowto.com/wp-content/uploads/2009/01/search_php.txt" target="_blank">search.php</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h3>Create a Search Page to Display the Google Custom Search Results</h3>
<ul>
<li>Create a new page named <strong>Search</strong> via the <strong>Page → Add New </strong>command on the left menu in the Admin panel.</li>
<li>Edit the post slug if needed to ensure Permalink is <strong>http://your_domain_name/search/</strong></li>
<li>Click the <strong>HTML</strong> tab in the post editor.</li>
<li>Paste the Google Search result code.</li>
<li>Save and publish the page. This will create the Page ID.</li>
<li>Edit the page again.</li>
<li>Write down the Page ID as given in the URL of the web browser because it will be needed later. The Page ID is the number after the &#8220;post=&#8221; argument. In my case, the Search Page ID is <span style="color: #ff0000;"><strong>7</strong></span> in the URL:<br />
http://www.handymanhowto.com/wp-admin/page.php?action=edit&amp;post=<strong><span style="color: #ff0000;">7</span></strong></li>
<li>Assign the <strong>Search Results</strong> page template in the drop down menu as shown (lower left in the image below).</li>
<li>Save and publish the page.</li>
</ul>
<p>Click on the image below for a full size view.</p>
<div id="attachment_3301" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/Search-Page-for-Google-Custom-Search.png"><img class="size-medium wp-image-3301" title="Search Page for Google Custom Search" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/Search-Page-for-Google-Custom-Search-450x281.png" alt="Search Page for Google Custom Search" width="450" height="281" /></a><p class="wp-caption-text">Search Page for Google Custom Search</p></div>
<p>Next, the Google Custom Search box will be added to the page header.</p>
<h3>Changes to header.php</h3>
<p>Now we&#8217;ll add the Google Custom Search Control to the page header and make a cosmetic change suppress the Search page from showing in the main menu.</p>
<h4>Cosmetic Change</h4>
<p>The Search page is shown by default in the menu bar at the very top of the web page. If a visitor to your site clicks on the Search menu item, an empty Search page will be displayed, which is confusing.</p>
<p>To remove the Search page from the header menu:</p>
<ul>
<li>Edit the <strong>header.php</strong> file in the freshnews theme directory (e.g. <strong>/public_html/wp-content/themes/freshnews/header.php</strong>). You can make the changes to header.php using the WordPress Theme Editor.</li>
<li>Add the code <strong>&amp;exclude=&lt;your Search Page ID&gt;</strong> to the wp_list_pages() function as shown in the image below.<br />
→ Recall the Search Page ID was written down when the Search page was created (see above). The Page ID for my Search page is <strong>7</strong>.</li>
</ul>
<div id="attachment_3293" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/header_php-Exclude-Search-Page-from-Main-Menu.png"><img class="size-medium wp-image-3293" title="header.php - Exclude the Search page from Main Menu" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/header_php-Exclude-Search-Page-from-Main-Menu-450x281.png" alt="header.php - Exclude the Search page from Main Menu" width="450" height="281" /></a><p class="wp-caption-text">header.php - Exclude the Search page from Main Menu</p></div>
<p>continue to the next step&#8230;</p>
<h4>Add the Google Custom Search Box to the Page Header</h4>
<p>While still editing header.php,  replace the default search box code as highlighted:</p>
<div id="attachment_3291" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/header_php-default-Search-code.png"><img class="size-medium wp-image-3291" title="header.php - Default Search Code" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/header_php-default-Search-code-450x281.png" alt="header.php - Default Search Code" width="450" height="281" /></a><p class="wp-caption-text">header.php - Default Search Code</p></div>
<p>with the Google Search box code as shown below. Also add the <strong>&lt;br&gt;</strong> HTML code as indicated to move the Search box submit button below the text input control.</p>
<div id="attachment_3292" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/header_php-Google-Custom-Search-code.png"><img class="size-medium wp-image-3292" title="header.php - Google Custom Search code" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/header_php-Google-Custom-Search-code-450x281.png" alt="header.php - Google Custom Search code" width="450" height="281" /></a><p class="wp-caption-text">header.php - Google Custom Search code</p></div>
<p>The modified Fresh News v2.0.7 header.php file for my site is here: <a title="header.php page template file" href="http://www.handymanhowto.com/wp-content/uploads/2009/01/header_php.txt" target="_blank">header.php</a></p>
<blockquote><p><strong>Remember: </strong></p>
<p>Your Search page URL, Page ID and Adsense Publisher ID values <strong>will be different from mine</strong> and should be changed in your version of header.php. Or you can use mine if you like giving me your Adsense revenue. (smile)</p></blockquote>
<p>Save and test your new Google Custom Search Engine.</p>
<p>Remember, to re-edit the <strong>header.php</strong> and possibly the <strong>search.php</strong> templates if you install a Fresh News theme update.</p>
<p>Hope this helps,</p>
<p>Bob Jackson</p>
<p></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It!</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F" rel="nofollow" title="Add to&nbsp;Squidoo"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/squidoo.png" title="Add to&nbsp;Squidoo" alt="Add to&nbsp;Squidoo" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F09%2F13%2Fgoogle-custom-search-integration-with-woothemes-fresh-news-2-0-part-2%2F&amp;t=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+2" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.handymanhowto.com/2009/09/13/google-custom-search-integration-with-woothemes-fresh-news-2-0-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Automate Exterior Lights with an Insteon Wireless Motion Sensor</title>
		<link>http://www.handymanhowto.com/2009/05/31/automate-exterior-lights-with-an-insteon-wireless-motion-sensor/</link>
		<comments>http://www.handymanhowto.com/2009/05/31/automate-exterior-lights-with-an-insteon-wireless-motion-sensor/#comments</comments>
		<pubDate>Sun, 31 May 2009 21:03:07 +0000</pubDate>
		<dc:creator>Bob Jackson</dc:creator>
				<category><![CDATA[Electrical]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[2420M]]></category>
		<category><![CDATA[Access Point]]></category>
		<category><![CDATA[admin console]]></category>
		<category><![CDATA[dawn]]></category>
		<category><![CDATA[dusk]]></category>
		<category><![CDATA[Ethernet]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[exterior light]]></category>
		<category><![CDATA[folders]]></category>
		<category><![CDATA[how to automate lights]]></category>
		<category><![CDATA[how to install an Insteon motion sensor]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Insteon]]></category>
		<category><![CDATA[internet access]]></category>
		<category><![CDATA[ISY-99i]]></category>
		<category><![CDATA[light switch]]></category>
		<category><![CDATA[lighting control]]></category>
		<category><![CDATA[My Lighting]]></category>
		<category><![CDATA[Power Line Modem]]></category>
		<category><![CDATA[PowerLinc]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[schedule]]></category>
		<category><![CDATA[SmartHome]]></category>
		<category><![CDATA[SmartLabs]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[ToggleLinc]]></category>
		<category><![CDATA[Universal Devices]]></category>
		<category><![CDATA[web browser]]></category>
		<category><![CDATA[wireless motion sensor]]></category>
		<category><![CDATA[WRT-54G]]></category>

		<guid isPermaLink="false">http://www.handymanhowto.com/?p=2099</guid>
		<description><![CDATA[My front porch has pendant lights suspended by chains and is controlled by a standard light switch. I automated the porch lights with Insteon home automation controls purchased from SmartHome.com. I covered the Insteon ToggleLinc light switch installation in this article. The related ISY-99i home automation controller is discussed here. The Insteon Motion Sensor is [...]]]></description>
			<content:encoded><![CDATA[<p>My front porch has pendant lights suspended by chains and is controlled by a standard light switch. I automated the porch lights with <a title="Insteon - a SmartLabs Technology" href="http://www.insteon.net/" target="_blank">Insteon</a> home automation controls purchased from <a title="SmartHome - The Home Automation Superstore" href="http://www.smarthome.com" target="_blank">SmartHome.com</a>. I covered the <a title="Install a SmartHome ToggleLinc Remote Control Light Switch - Part 1" href="http://www.handymanhowto.com/2009/05/30/install-a-smarthome-togglelinc-remote-control-light-switch-part-1/" target="_blank">Insteon ToggleLinc light switch installation in this article</a>. The related <a title="ISY-99i Overview" href="http://www.handymanhowto.com/2009/05/31/insteon-home-automation-controller-isy-99i/" target="_blank">ISY-99i home automation controller is discussed here</a>.</p>
<p>The Insteon Motion Sensor is a model <a title="2420M Motion Sensor" href="http://www.smarthome.com/2420M/Wireless-INSTEON-Motion-Occupancy-Sensor/p.aspx" target="_blank">2420M</a> as you see here. The 9 volt battery and mounting stand are included.</p>
<div id="attachment_2101" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/05/dsc02411.jpg"><img class="size-medium wp-image-2101" title="Insteon Wireless Motion Sensor 2420M" src="http://www.handymanhowto.com/wp-content/uploads/2009/05/dsc02411-450x377.jpg" alt="Insteon Wireless Motion Sensor 2420M" width="450" height="377" /></a><p class="wp-caption-text">Insteon Wireless Motion Sensor 2420M</p></div>
<p><span id="more-2099"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>Removing the battery cover reveals five jumper pins and Set button. Installation and operation are simple, the <a title="Motion Sensor Quick Start Guide" href="http://www.smarthome.com/manuals/2420mqs.pdf" target="_blank">Quick Start Guide</a> is available here with the details.</p>
<div id="attachment_2102" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/05/dsc02412.jpg"><img class="size-medium wp-image-2102" title="Insteon 2420M Motion Sensor - Rear View" src="http://www.handymanhowto.com/wp-content/uploads/2009/05/dsc02412-450x504.jpg" alt="Insteon 2420M Motion Sensor - Rear View" width="450" height="504" /></a><p class="wp-caption-text">Insteon 2420M Motion Sensor - Rear View</p></div>
<p>The motion sensor LED is quite bright and flashes when in &#8220;Link&#8221; mode after pressing the Set button. It also flashes when motion is detected. The LED brightness is configurable on a 0 to 100 scale through the ISY-99i Administrative Console, with 0 (zero) turning off the LED.</p>
<div id="attachment_2103" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/05/dsc02432.jpg"><img class="size-medium wp-image-2103" title="Motion Sensor LED" src="http://www.handymanhowto.com/wp-content/uploads/2009/05/dsc02432-450x514.jpg" alt="Motion Sensor LED" width="450" height="514" /></a><p class="wp-caption-text">Motion Sensor LED</p></div>
<h3>Access Point Wireless Phase Coupler</h3>
<p>The <a title="2420M Motion Sensor at SmartHome.com" href="http://www.smarthome.com/2420M/Wireless-INSTEON-Motion-Occupancy-Sensor/p.aspx" target="_blank">2420M motion sensor</a> is an RF only Insteon device and requires a <a title="Access Point - Insteon Wireless Phase Coupler" href="http://www.smarthome.com/_/ProductResults.aspx?Ntt=accesspoint" target="_blank">Access Point</a> RF receiver/phase coupler to communicate with the Insteon power line network. It&#8217;s simple to &#8220;link&#8221; the motion sensor by pressing the Set buttons on both devices per the product instructions.</p>
<h3>Customizing the Motion Sensor Settings</h3>
<p>The motion sensor <a title="Motion Sensor Linking" href="http://www.universal-devices.com/mwiki/index.php?title=ISY-99i/ISY-26_INSTEON:Linking_a_Motion_Sensor" target="_blank">Timeout, LED Brightness and Darkness Sensitivity</a> can be customized via the <a title="ISY-99i Quick Start Guide" href="http://www.universal-devices.com/mwiki/index.php?title=ISY-99i/ISY-26_INSTEON:Quick_Start_Guide" target="_blank">ISY-99i Administrative Console</a>. I left the timeout at the default of 1 minute, set the LED brightness down to 10 because the default value 75 is too bright at night, and left the Darkness Sensitivity at the default of 35.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h3>Linking the Motion Sensor</h3>
<p>The motion sensor is linked only to the Access Point wireless receiver. I <span style="text-decoration: underline;">did not link</span> the motion sensor to the ToggleLinc light switch because I will have an ISY-99i program decided what to do with the motion sensor events.</p>
<h3>Insteon Network Overview</h3>
<p>Now that I&#8217;ve installed the <a title="ToggleLinc products at SmartHome.com" href="http://www.smarthome.com/_/ProductResults.aspx?Ntt=togglelinc" target="_blank">ToggleLinc</a> switch, wireless motion sensor, <a title="Access Point - Insteon Wireless Phase Coupler" href="http://www.smarthome.com/_/ProductResults.aspx?Ntt=accesspoint" target="_blank">Access Point</a> wireless coupler, <a title="PowerLinc Power Line Modem" href="http://www.smarthome.com/2412S/PowerLinc-INSTEON-Modem-Serial/p.aspx" target="_blank">PowerLinc</a> power line modem and <a title="ISY-99i Home Automation Controller" href="http://www.smarthome.com/_/ProductResults.aspx?Ntt=isy-99i" target="_blank">ISY-99i</a> home automation controller &#8211; I&#8217;m ready to begin programming the ISY-99i.</p>
<p>This is my Insteon network so far (click on the image for larger view):</p>
<div id="attachment_2105" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/05/porch-light-network.jpg"><img class="size-medium wp-image-2105" title="Insteon Network Overview - Porch Lights Automation" src="http://www.handymanhowto.com/wp-content/uploads/2009/05/porch-light-network-450x300.jpg" alt="Insteon Network Overview - Porch Lights Automation" width="450" height="300" /></a><p class="wp-caption-text">Insteon Network Overview - Porch Lights Automation</p></div>
<h3>Motion Sensor Programming</h3>
<p>My requirements for the porch light program are:</p>
<ol>
<li>The porch lights will turn on for 10 minutes when motion is sensed from 30 minutes before sunset to 15 minutes after sunrise.</li>
<li>The motion sensor can be <strong>overridden</strong> by &#8220;double clicking&#8221; OFF, i.e. pressing the ToggleLinc switch OFF quickly two times, to keep the porch lights off indefinitely. This is useful when I want to look at the stars or for Halloween when the scene should be kept dark to view the decorations.</li>
<li>Manually turning the ToggleLinc switch ON will turn on the lights indefinitely and <strong>re-enable the motion sensor program</strong>. When the switch is manually turned OFF, the motion sensor program takes over again by default.</li>
</ol>
<p>In practice, the common scenarios are:</p>
<ul>
<li>Lights are controlled by the motion sensor by default.</li>
<li>If I turn the switch ON, the lights stay ON until I turn them OFF.</li>
<li>If I want to keep the porch lights off for a time, I double click OFF the light switch.</li>
<li>When I come back inside, I flip the light switch ON/OFF once to re-enable the motion sensor.</li>
</ul>
<p>An program upgrade would be to include a reset program to run, say, at 30 minutes past sunrise everyday to turn OFF the lights and re-enable the motion sensor in case I manually overrode the lights and forgot to turn them off. Hmm, I think I&#8217;ll add this feature &#8211; see the update later in this article.</p>
<p>The motion sensor program flow chart is:</p>
<div id="attachment_2100" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/05/porch-light-program-flow.jpg"><img class="size-medium wp-image-2100" title="Porch Light Program Flow Chart" src="http://www.handymanhowto.com/wp-content/uploads/2009/05/porch-light-program-flow-450x307.jpg" alt="Porch Light Program Flow Chart" width="450" height="307" /></a><p class="wp-caption-text">Porch Light Program Flow Chart</p></div>
<p>The ISY-99i program code is kept in a Folder named &#8216;Front Porch Light&#8217;.</p>
<blockquote>
<pre><span style="color: #0000ff;">Folder Conditions for 'Front Porch Light'
Add conditions to limit when programs in this folder are allowed to run.</span></pre>
<pre><span style="color: #0000ff;">If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')</span></pre>
<pre><span style="color: #0000ff;">Then
   Allow the programs in this folder to run.</span></pre>
<pre><span style="color: #008000;">Comment:
The programs in this folder are:
1) 'Porch Motion Sensed'
2) 'Porch Light On 10 Minutes'
3) 'Porch Light Switched On'
4) 'Porch Light Switched Fast Off'
</span></pre>
<pre>===========</pre>
<pre><span style="color: #0000ff;">
Program Content for 'Porch Motion Sensed'</span></pre>
<pre><span style="color: #0000ff;">If
   From    Sunset  - 30 minutes
   To      Sunrise + 15 minutes (next day)
   And Control 'Porch Motion Sensor' is switched On
   And (
         Status  'Front Porch Light Switch' is not On
         And Program 'Porch Light On 10 Minutes' is False
       )</span></pre>
<pre><span style="color: #0000ff;">Then
   Run Program 'Porch Light On 10 Minutes' (Then Path)</span></pre>
<pre><span style="color: #0000ff;">Else
   - No Actions - (To add one, press 'Action')
</span></pre>
<pre>===============</pre>
<pre><span style="color: #0000ff;">
Program Content for 'Porch Light On 10 Minutes'</span></pre>
<pre><span style="color: #0000ff;">If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')</span></pre>
<pre><span style="color: #0000ff;">Then
   Set 'Front Porch Light Switch' On
   Wait  10 minutes
   Set 'Front Porch Light Switch' Off
   Run Program 'Porch Light On 10 Minutes' (Else Path)</span></pre>
<pre><span style="color: #0000ff;">Else
   - No Actions - (To add one, press 'Action')</span></pre>
<pre><span style="color: #339966;">Comment:
Turns the porch light on for 10 minutes. A program is used such that
the 'Wait' isn't reinitialized by new events triggering If conditions.
</span></pre>
<pre>================</pre>
<pre><span style="color: #0000ff;">
Program Content for 'Porch Light Switched On'</span></pre>
<pre><span style="color: #0000ff;">If Control 'Front Porch Light Switch' is switched On</span></pre>
<pre><span style="color: #0000ff;">Then
   Stop program 'Porch Motion Sensed'
   Enable Program 'Porch Motion Sensed'
   Run Program 'Porch Light On 10 Minutes' (Else Path)</span></pre>
<pre><span style="color: #0000ff;">Else
   - No Actions - (To add one, press 'Action')</span></pre>
<pre><span style="color: #339966;">Comment:
This program returns control to the motion sensor and reinitializes
the conditional logic flags.
Run Program (Else Path) to reset the motion on/off flag.
</span></pre>
<pre>===============</pre>
<pre><span style="color: #0000ff;">
Program Content for 'Porch Light Switched Fast Off'</span></pre>
<pre><span style="color: #0000ff;">If Control 'Front Porch Light Switch' is switched Fast Off</span></pre>
<pre><span style="color: #0000ff;">Then
   Stop program 'Porch Motion Sensed'
   Disable Program 'Porch Motion Sensed'
   Run Program 'Porch Light On 10 Minutes' (Else Path)</span></pre>
<pre><span style="color: #0000ff;">Else
   - No Actions - (To add one, press 'Action')</span></pre>
<pre><span style="color: #339966;">Comment:
Double tap (Fast Off) disables the motion sensor such that the
porch light stays off until the switch is manually turned on again.
Purpose of the 'Run Program ... (Else Path)' is to reset the motion
on/off flag.</span></pre>
</blockquote>
<h3>Bonus Program</h3>
<p>I added this new program to turn off porch lights at dawn and reset the motion sensor control in case I manually overrode the motion sensor and forgot to turn OFF the lights. This ensures the motion sensor code is is ready for the next night.</p>
<blockquote>
<pre><span style="color: #0000ff;">Program Content for 'Porch Light Daily Reset'

</span><span style="color: #0000ff;">If</span><span style="color: #0000ff;">
   Time is Sunrise + 30 minutes</span></pre>
<pre><span style="color: #0000ff;">Then</span><span style="color: #0000ff;">
   Set 'Front Porch Light Switch' Off</span><span style="color: #0000ff;">
   Run Program 'Porch Light On 10 Minutes' (Else Path)
   Enable Program 'Porch Motion Sensed'</span></pre>
<pre><span style="color: #0000ff;">Else
   - No Actions - (To add one, press 'Action')</span></pre>
<pre><span style="color: #339966;">Comment:
Turns off the porch lights 30 minutes after dawn and resets the
program flags in case the lights were manually overridden and left
on all night.</span></pre>
</blockquote>
<p>This is how the programs are organized in the ISY-99i Admin Console (click for a full size image):</p>
<div id="attachment_2119" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/05/isy-99i-admin-console-porch-light-program.jpg"><img class="size-medium wp-image-2119" title="Porch Light Programs in the ISY-99i Admin Console" src="http://www.handymanhowto.com/wp-content/uploads/2009/05/isy-99i-admin-console-porch-light-program-450x265.jpg" alt="Porch Light Programs in the ISY-99i Admin Console" width="450" height="265" /></a><p class="wp-caption-text">Porch Light Programs in the ISY-99i Admin Console</p></div>
<p>For more information on the ISY-99i, the <a title="ISY-99i Series INSTEON Wiki" href="http://www.universal-devices.com/mwiki/index.php?title=ISY-99i_Series_INSTEON" target="_blank">Universal Devices Wiki page</a> is an excellent resource.</p>
<p>Hope this helps,</p>
<p>Bob Jackson</p>
<p></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It!</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F&amp;title=Automate+Exterior+Lights+with+an+Insteon+Wireless+Motion+Sensor" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F&amp;title=Automate+Exterior+Lights+with+an+Insteon+Wireless+Motion+Sensor" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F&amp;title=Automate+Exterior+Lights+with+an+Insteon+Wireless+Motion+Sensor" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F&amp;title=Automate+Exterior+Lights+with+an+Insteon+Wireless+Motion+Sensor" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F&amp;title=Automate+Exterior+Lights+with+an+Insteon+Wireless+Motion+Sensor" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F" rel="nofollow" title="Add to&nbsp;Squidoo"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/squidoo.png" title="Add to&nbsp;Squidoo" alt="Add to&nbsp;Squidoo" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F05%2F31%2Fautomate-exterior-lights-with-an-insteon-wireless-motion-sensor%2F&amp;t=Automate+Exterior+Lights+with+an+Insteon+Wireless+Motion+Sensor" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.handymanhowto.com/2009/05/31/automate-exterior-lights-with-an-insteon-wireless-motion-sensor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Integrate Google Adsense with the Fresh News Theme Sidebar Ad</title>
		<link>http://www.handymanhowto.com/2009/03/15/integrate-google-adsense-with-the-fresh-news-theme-sidebar-ad/</link>
		<comments>http://www.handymanhowto.com/2009/03/15/integrate-google-adsense-with-the-fresh-news-theme-sidebar-ad/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 01:01:36 +0000</pubDate>
		<dc:creator>Bob Jackson</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[300x250 ad unit]]></category>
		<category><![CDATA[ads-300x250.php]]></category>
		<category><![CDATA[Banner Ad Sidebar Widget 300x250]]></category>
		<category><![CDATA[fresh news]]></category>
		<category><![CDATA[Fresh News 2.0]]></category>
		<category><![CDATA[Fresh News Options Side Bar Ad]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[How to integrate Google Adsense with WooThemes Fresh News]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sidebar ad]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[woothemes]]></category>
		<category><![CDATA[WooThemes customization]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.handymanhowto.com/?p=1896</guid>
		<description><![CDATA[I use the Fresh News Theme by WooThemes for the overall look and feel of HandyManHowTo.com.  Several people have asked me &#8220;How did you integrate Google Adsense into the Fresh News Theme 300&#215;250 Block Ad in the Sidebar?&#8220;. An example is the &#8220;Zoom Plumbing&#8221; Google Ad in the screen grab below. Here&#8217;s how to do [...]]]></description>
			<content:encoded><![CDATA[<p>I use the <a title="WooThemes" href="http://www.woothemes.com/category/themes/" target="_blank">Fresh News</a> Theme by <a title="WooThemes for WordPress" href="http://www.woothemes.com" target="_blank">WooThemes</a> for the overall look and feel of <a title="HandyManHowTo.com" href="http://www.handymanhowto.com" target="_blank">HandyManHowTo.com</a>.  Several people have asked me &#8220;<em>How did you integrate Google Adsense into the Fresh News Theme 300&#215;250 Block Ad in the Sidebar?</em>&#8220;. An example is the &#8220;<strong>Zoom Plumbing</strong>&#8221; Google Ad in the screen grab below.</p>
<div id="attachment_1897" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/03/hmht.jpg"><img class="size-medium wp-image-1897" title="HandymanHowTo.com with 300x250 Google Adsense Ad in Sidebar" src="http://www.handymanhowto.com/wp-content/uploads/2009/03/hmht-450x270.jpg" alt="HandymanHowTo.com with 300x250 Google Adsense Ad in Sidebar" width="450" height="270" /></a><p class="wp-caption-text">HandymanHowTo.com with 300x250 Google Adsense Ad in Sidebar</p></div>
<p>Here&#8217;s how to do it&#8230;</p>
<p><span id="more-1896"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h3>Create a 300&#215;250 Google Adsense Unit</h3>
<ol>
<li>Log into your <a title="Google Adsense Account Management" href="http://adsense.google.com">Google Adsense</a> account.</li>
<li>Create a text and image, square, &#8220;300&#215;250 Medium Rectangle Ad&#8221;.</li>
<li>Copy and save the AdSense Unit Code. The code for my 300&#215;250 ad is:</li>
</ol>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;&lt;!&#8211;<br />
google_ad_client = &#8220;pub-2484226848394294&#8243;;<br />
/* 300&#215;250, created 10/11/08 */<br />
google_ad_slot = &#8220;9756119931&#8243;;<br />
google_ad_width = 300;<br />
google_ad_height = 250;<br />
//&#8211;&gt;<br />
&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;<br />
src=&#8221;http://pagead2.googlesyndication.com/pagead/show_ads.js&#8221;&gt;<br />
&lt;/script&gt;</p></blockquote>
<h1>Fresh News <span style="color: #ff0000;">version 2.x</span> Instructions</h1>
<p>WooThemes made it <strong><span style="color: #008000;"><span style="text-decoration: underline;">really easy</span></span></strong> to create a sidebar banner ad in <a title="WooThemes - Fresh News" href="http://www.woothemes.com/2008/04/fresh-news/" target="_blank">Fresh News version 2.x</a> with the new <a title="Fresh News 2.0" href="http://www.woothemes.com/2009/06/fresh-news-2-0/" target="_blank">WooTheme framework</a>. Scroll down for the Fresh News version 1.x instructions if you haven&#8217;t upgraded to 2.x.</p>
<h4>Step 1: Log into to the WordPress Admin panel.</h4>
<h4>Step 2: Click the blue &#8220;Woo&#8221; icon on the left navigation menu.</h4>
<h4>Step 3: Click the &#8220;Banner Ad Sidebar &#8211; Widget (300&#215;250).</h4>
<h4>Step 4: Paste your 300&#215;250 Adsense Unit Code into the box as shown:</h4>
<div id="attachment_3283" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/03/Banner-Ad-Sidebar-Widget-300x250.PNG"><img class="size-medium wp-image-3283" title="Woo Themes - Banner Ad Sidebar Widget 300x250 Adsense Code" src="http://www.handymanhowto.com/wp-content/uploads/2009/03/Banner-Ad-Sidebar-Widget-300x250-450x434.PNG" alt="Woo Themes - Banner Ad Sidebar Widget 300x250 Adsense Code" width="450" height="434" /></a><p class="wp-caption-text">Woo Themes - Banner Ad Sidebar Widget 300x250 Adsense Code</p></div>
<h4>Step 5: Click &#8220;Save All Changes&#8221;.</h4>
<h4>Step 6: Under the Appearance menu on the left nav bar, click Widgets.</h4>
<h4>Step 7: Click and drag the &#8220;Woo &#8211; Ad 300&#215;250&#8243; widget to the side bar as shown.</h4>
<div id="attachment_3284" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/03/Woo-Ad-300x250-Widget.PNG"><img class="size-medium wp-image-3284" title="Woo Ad 300x250 Sidebar Widget - Google Adsense" src="http://www.handymanhowto.com/wp-content/uploads/2009/03/Woo-Ad-300x250-Widget-450x281.PNG" alt="Woo Ad 300x250 Sidebar Widget - Google Adsense" width="450" height="281" /></a><p class="wp-caption-text">Woo Ad 300x250 Sidebar Widget - Google Adsense</p></div>
<p>And that&#8217;s all! You now have a Google Adsense 300&#215;250 ad in your Fresh News theme sidebar.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h1>Fresh News <span style="color: #ff0000;">version 1.x</span> Instructions</h1>
<p>These instructions are for the Fresh News version 1.x only.</p>
<h3>Edit  ads-300&#215;250.php</h3>
<p><a title="WooThemes for WordPress" href="http://www.woothemes.com" target="_blank">WooThemes</a> executes the <a title="PHP Scripting Language" href="http://www.php.net/" target="_blank">PHP</a> code in the <strong>ads-300&#215;250.php</strong> file to paint the content of the 300&#215;250 pixel block ad in the sidebar. The file is located in the</p>
<p style="padding-left: 30px;">/public_html/wp-content/themes/freshnews/ads</p>
<p>directory on your website.</p>
<ol>
<li>Make a backup copy of the  <strong>ads-300&#215;250.php</strong></li>
<li>Edit  <strong>ads-300&#215;250.php</strong></li>
<li>Replace the content of the <strong>&lt;div id=&#8221;mpu_banner&#8221;&gt;</strong> &#8230;. <strong>&lt;/div&gt;</strong><br />
in both places of the file with your Adsense Unit Code.</li>
</ol>
<p style="padding-left: 30px;"><strong>Original Code Block</strong></p>
<blockquote><p>&lt;div class=&#8221;box2&#8243;&gt;</p>
<p>&lt;div id=&#8221;mpu_banner&#8221;&gt;</p>
<p>&lt;?php</p>
<p>// Get block code //<br />
$block_img = get_option(&#8216;woo_block_image&#8217;);<br />
$block_url = get_option(&#8216;woo_block_url&#8217;);</p>
<p>?&gt;</p>
<p>&lt;a &lt;?php do_action(&#8216;woo_external_ad_link&#8217;); ?&gt; href=&#8221;&lt;?php echo &#8220;$block_url&#8221;; ?&gt;&#8221;&gt;&lt;img src=&#8221;&lt;?php echo &#8220;$block_img&#8221;; ?&gt;&#8221; alt=&#8221;" /&gt;&lt;/a&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;/div&gt;</p></blockquote>
<p style="padding-left: 30px;"><strong>Google Adsense Code Block</strong></p>
<blockquote><p>&lt;div class=&#8221;box2&#8243;&gt;</p>
<p>&lt;div id=&#8221;mpu_banner&#8221;&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;&lt;!&#8211;<br />
google_ad_client = &#8220;pub-2484226848394294&#8243;;<br />
/* 300&#215;250, created 10/11/08 */<br />
google_ad_slot = &#8220;9756119931&#8243;;<br />
google_ad_width = 300;<br />
google_ad_height = 250;<br />
//&#8211;&gt;<br />
&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;<br />
src=&#8221;http://pagead2.googlesyndication.com/pagead/show_ads.js&#8221;&gt;<br />
&lt;/script&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;/div&gt;</p></blockquote>
<p>The original and changed source files are here for comparison. I&#8217;ve renamed the files to a .txt extension to prevent WordPress from executing the files when clicking on the links.</p>
<p>Default theme file: <a href="http://www.handymanhowto.com/wp-content/uploads/2009/03/ads-300x250-originalphp.txt">ads-300&#215;250-original.php</a></p>
<p>Google Adsense file: <a href="http://www.handymanhowto.com/wp-content/uploads/2009/03/ads-300x250php.txt">ads-300&#215;250.php</a></p>
<p>Good luck with your website!</p>
<p>Take care,</p>
<p>Bob Jackson</p>
<p></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It!</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F&amp;title=Integrate+Google+Adsense+with+the+Fresh+News+Theme+Sidebar+Ad" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F&amp;title=Integrate+Google+Adsense+with+the+Fresh+News+Theme+Sidebar+Ad" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F&amp;title=Integrate+Google+Adsense+with+the+Fresh+News+Theme+Sidebar+Ad" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F&amp;title=Integrate+Google+Adsense+with+the+Fresh+News+Theme+Sidebar+Ad" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F&amp;title=Integrate+Google+Adsense+with+the+Fresh+News+Theme+Sidebar+Ad" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F" rel="nofollow" title="Add to&nbsp;Squidoo"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/squidoo.png" title="Add to&nbsp;Squidoo" alt="Add to&nbsp;Squidoo" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F03%2F15%2Fintegrate-google-adsense-with-the-fresh-news-theme-sidebar-ad%2F&amp;t=Integrate+Google+Adsense+with+the+Fresh+News+Theme+Sidebar+Ad" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.handymanhowto.com/2009/03/15/integrate-google-adsense-with-the-fresh-news-theme-sidebar-ad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Custom Search Integration with WooThemes Fresh News 2.0 &#8211; Part 1</title>
		<link>http://www.handymanhowto.com/2009/01/03/google-custom-search-integration-with-woo-themes-freshnews/</link>
		<comments>http://www.handymanhowto.com/2009/01/03/google-custom-search-integration-with-woo-themes-freshnews/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 17:33:01 +0000</pubDate>
		<dc:creator>Bob Jackson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[cse]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[fresh news]]></category>
		<category><![CDATA[google custom search engine]]></category>
		<category><![CDATA[header.php]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[how to integrate google custom search with wordpress]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[make money]]></category>
		<category><![CDATA[page template]]></category>
		<category><![CDATA[page.php]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[search.php]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[woothemes]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.handymanhowto.com/?p=1083</guid>
		<description><![CDATA[Newly revised and updated for Fresh News 2.0! I wanted to replace the WordPress search engine with the Google Custom Search Engine (CSE) for better results and to take advantage of Adsense for Search. While there are several CSE integration tutorials for WordPress and even a plugin, none specifically addressed Woo Themes. My efforts were [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Newly revised and updated for <a title="Fresh News 2.0 by WooThemes" href="http://www.woothemes.com/2009/06/fresh-news-2-0/" target="_blank">Fresh News 2.0</a>!</strong></p>
<p>I wanted to replace the WordPress search engine with the Google Custom Search Engine (CSE) for better results and to take advantage of Adsense for Search. While there are several <a title="How to Set up Google Custom Search for Your Website and Make Money" href="http://www.doshdosh.com/how-to-set-up-google-custom-search-and-make-money/" target="_blank">CSE integration tutorials for WordPress</a> and even a <a title="Google Custom Search Plugin for WordPress" href="http://aleembawany.com/projects/wordpress/google-custom-search-plugin/" target="_blank">plugin</a>, none specifically addressed <a title="WooThemes" href="http://www.woothemes.com/" target="_blank">Woo Themes</a>. My efforts were further frustrated because the coding strategies outlined in the existing tutorials didn’t entirely work for me and the WordPress plugin failed to install with a PHP parse error.</p>
<p>My requirements for Google Custom Search are:</p>
<ul>
<li>Search box must appear in the same position as the default search box to the top right in the theme header.</li>
<li>Due to the limited width of the FreshNews DIV element (block level container) in the header for the search box, the “Search” button needed to appear <strong>below</strong> the text input control instead of to the right.</li>
<li>The side bar <strong>must not</strong> be displayed on the Google Search Results page, because Google takes the full page width (600 pixels) and the sidebar will overlay the search results.</li>
</ul>
<p><span id="more-1083"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h3>Google Custom Search Engine Demo</h3>
<p>Go to <a title="HandymanHowTo.com" href="http://www.handymanhowto.com" target="_blank">www.handymanhowto.com</a> to see the Google Custom Search integration with Fresh News 2.0. The following illustrates the Google Custom Search box (red arrow):</p>
<div id="attachment_3288" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/HandyManHowTo-Google-Custom-Search.png"><img class="size-medium wp-image-3288" title="HandyManHowTo.com - Google Custom Search" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/HandyManHowTo-Google-Custom-Search-450x281.png" alt="HandyManHowTo.com - Google Custom Search" width="450" height="281" /></a><p class="wp-caption-text">HandyManHowTo.com - Google Custom Search</p></div>
<p>and the Google Custom Search results page for the phrase &#8220;pvc pipe&#8221;:</p>
<div id="attachment_3289" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/HandyManHowTo-Google-Custom-Search-Results.png"><img class="size-medium wp-image-3289" title="HandyManHowTo.com - Google Custom Search Results Page" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/HandyManHowTo-Google-Custom-Search-Results-450x281.png" alt="HandyManHowTo.com - Google Custom Search Results Page" width="450" height="281" /></a><p class="wp-caption-text">HandyManHowTo.com - Google Custom Search Results Page</p></div>
<p>Google does an excellent job of indexing and searching your site.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2484226848394294";
google_ad_slot = "3301193618";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h3>How to integrate Google Custom Search to <a title="FreshNews Theme for WordPress by Woo Themes" href="http://www.woothemes.com/2008/04/fresh-news/" target="_blank">Fresh News 2.0</a></h3>
<ul>
<li>Go to <a title="Google Custom Search Engine" href="http://www.google.com/coop/cse/" target="_blank">http://www.google.com/coop/cse/</a> and register for an account. If you already have an Adsense account, login with those credentials.</li>
<li>Create a New Search Engine.</li>
<li>Under the “Look and Feel” tab, choose the first style with the watermark. Click on the following image for a larger view.</li>
</ul>
<div id="attachment_1088" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/cse-look-and-feel.jpg"><img class="size-medium wp-image-1088" title="Google Custom Search Engine - Look and Feel" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/cse-look-and-feel-450x243.jpg" alt="Google Custom Search Engine - Look and Feel" width="450" height="243" /></a><p class="wp-caption-text">Google Custom Search Engine - Look and Feel</p></div>
<p>On the Code tab:</p>
<ul>
<li>choose the <strong>iframe</strong> option;</li>
<li>specify a URL http://your_domain_name<strong>/search/</strong></li>
<li>place advertising on the <strong>Right</strong>.</li>
</ul>
<div id="attachment_1085" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/cse-code.jpg"><img class="size-medium wp-image-1085" title="Google Custom Search Engine - Code" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/cse-code-450x299.jpg" alt="Google Custom Search Engine - Code" width="450" height="299" /></a><p class="wp-caption-text">Google Custom Search Engine - Code</p></div>
<p>Copy the “<strong>Search box code</strong>” and “<strong>Search results code</strong>”. The code samples for my site are:</p>
<h4>Search box code</h4>
<blockquote>
<pre>&lt;style type="text/css"&gt;</pre>
<pre>@import url(http://www.google.com/cse/api/branding.css);</pre>
<pre>&lt;/style&gt;</pre>
<pre>&lt;div class="cse-branding-bottom" style="background-color:#000000;color:#FFFFFF"&gt;</pre>
<pre>  &lt;div class="cse-branding-form"&gt;</pre>
<pre>    &lt;form action="http://www.handymanhowto.com/search/" id="cse-search-box"&gt;</pre>
<pre>      &lt;div&gt;</pre>
<pre>        &lt;input type="hidden" name="cx" value="<span style="color: #ff0000;">006667729864162168081:5u85mytsil8</span>" /&gt;</pre>
<pre>        &lt;input type="hidden" name="cof" value="FORID:9" /&gt;</pre>
<pre>        &lt;input type="hidden" name="ie" value="UTF-8" /&gt;</pre>
<pre>        &lt;input type="text" name="q" size="31" /&gt;</pre>
<pre>        &lt;input type="submit" name="sa" value="Search" /&gt;</pre>
<pre>      &lt;/div&gt;</pre>
<pre>    &lt;/form&gt;</pre>
<pre>  &lt;/div&gt;</pre>
<pre>  &lt;div class="cse-branding-logo"&gt;</pre>
<pre>    &lt;img src="http://www.google.com/images/poweredby_transparent/poweredby_000000.gif" alt="Google" /&gt;</pre>
<pre>  &lt;/div&gt;</pre>
<pre>  &lt;div class="cse-branding-text"&gt;</pre>
<pre>    Custom Search</pre>
<pre>  &lt;/div&gt;</pre>
<pre>&lt;/div&gt;</pre>
</blockquote>
<p>Note the key value highlighted above in <span style="color: #ff0000;">red</span> will be different for your web site.</p>
<h4>Search result code</h4>
<blockquote>
<pre>&lt;div id="cse-search-results"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 600;
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
&lt;/script&gt;
&lt;script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"&gt;&lt;/script&gt;</pre>
</blockquote>
<p>Click on the Make Money tab to link the Custom Search Engine (CSE) to your Adsense account. My CSE has already been linked with my Adsense account.</p>
<div id="attachment_1089" class="wp-caption alignnone" style="width: 460px"><a href="http://www.handymanhowto.com/wp-content/uploads/2009/01/cse-make-money.jpg"><img class="size-medium wp-image-1089" title="Google Custom Search - Make Money" src="http://www.handymanhowto.com/wp-content/uploads/2009/01/cse-make-money-450x134.jpg" alt="Google Custom Search - Make Money" width="450" height="134" /></a><p class="wp-caption-text">Google Custom Search - Make Money</p></div>
<p>This tutorial is continued in <a title="Google Custom Search Integration with WooThemes Fresh News – Part 2" href="http://www.handymanhowto.com/2009/09/13/google-custom-search-integration-with-woothemes-fresh-news-2-0-part-2/" target="_blank">Part 2</a>.</p>
<p>Hope this helps,</p>
<p>Bob Jackson</p>
<p></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It!</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F&amp;title=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F" rel="nofollow" title="Add to&nbsp;Squidoo"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/squidoo.png" title="Add to&nbsp;Squidoo" alt="Add to&nbsp;Squidoo" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.handymanhowto.com%2F2009%2F01%2F03%2Fgoogle-custom-search-integration-with-woo-themes-freshnews%2F&amp;t=Google+Custom+Search+Integration+with+WooThemes+Fresh+News+2.0+%26%238211%3B+Part+1" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.handymanhowto.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.handymanhowto.com/2009/01/03/google-custom-search-integration-with-woo-themes-freshnews/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
