<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to Customize Your Random Header Images</title>
	<atom:link href="http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/</link>
	<description>A 3-column template system with rotating header images</description>
	<lastBuildDate>Fri, 03 Feb 2012 06:56:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Bill Weissbard</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1076</link>
		<dc:creator>Bill Weissbard</dc:creator>
		<pubDate>Fri, 03 Feb 2012 06:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1076</guid>
		<description>WOW !!!!
I love this theme!
I was looking for a 3 column theme for my new blog. I wanted to put some affiliate links in the third col. I was impressed first that this theme worked well right out of the box (not all themes do you know) and I like the explanation of rotating banners in this post because it was very clear and to the point. Thanks for that - Chris.  

I decided to extend the code to rotate my affiliate links as well. Here&#039;s how I did it. There are three steps - do them in this order.

1] create a new file named &quot;rotating_affiliates.php&quot; this goes at the same level as the sidebar.php file in your hosting account.

2] add this code to the bottom of the &quot;sidebar.php&quot; file, just above the &quot;categories&quot; section.

&lt;!--  This the new path to rotating affiliate banners  --&gt;
	


&lt;!--  This ends the path to rotating affiliate banners  --&gt;

3]  Last step is to build the &quot;rotating_affiliates.php&quot; code.  Create an array of your affiliate links, the form is;


&lt;?php

//  This section includes all the affiliate links and banners

$affiliate[1]=&quot;&lt;a&gt;&lt;/a&gt; &quot;; 

The usemap attribute scales a 300x250 banner so it fits right in the available column space. Construct as many links as you want ;
$affiliate[2]=
$affiliate[3]=           etc.  I created 9 links for this site
?&gt;
Next you need code to randomize the links.  I chose to display 3 links at a time, and rotate them on refresh.  This code helps ensure that you don&#039;t repeat any banner more than once in each refresh and ensures that the 3 banners displayed are not the same ones you displayed on the last refresh.



&lt;!-- Here&#039;s a non-repeating random number generator courtesy of www.phpbuilder.com --&gt;

&lt;?php
// Populate first 3 positions of a new array with the last instances of the displayed indexes

	for ($k=1; $k&lt;=3; $k++)
		 {
		$test_array[k]=$display_affiliate[$k];
		 } 


   $nonrepeatarray = array();
   for($m = 1; $m &lt;=3; $m++) {
      $rand = rand(1,9);
      
      //ensure value isn&#039;t already in the array
      //if it is, recalculate the rand until we
      //find one that&#039;s not in the array
      while(in_array($rand,$nonrepeatarray)) {
        $rand = rand(1,9);
      }
      
      //add it to the array
      $nonrepeatarray[$m+3] = $rand;
   }

	for ($p=1; $p&lt;=3; $p++)
		 {
		$display_affiliate[$p]=$nonrepeatarray[$p+3];
		 } 


 // This section displays the banners selected by the random number generator 
	for ($i=1; $i&lt;=$display; $i++)
		 {
		echo &quot;&quot;.$affiliate[$display_affiliate[$i]].&quot;&quot;;
		 } 

?&gt; 

Hope you like this,
Bill</description>
		<content:encoded><![CDATA[<p>WOW !!!!<br />
I love this theme!<br />
I was looking for a 3 column theme for my new blog. I wanted to put some affiliate links in the third col. I was impressed first that this theme worked well right out of the box (not all themes do you know) and I like the explanation of rotating banners in this post because it was very clear and to the point. Thanks for that &#8211; Chris.  </p>
<p>I decided to extend the code to rotate my affiliate links as well. Here&#8217;s how I did it. There are three steps &#8211; do them in this order.</p>
<p>1] create a new file named &#8220;rotating_affiliates.php&#8221; this goes at the same level as the sidebar.php file in your hosting account.</p>
<p>2] add this code to the bottom of the &#8220;sidebar.php&#8221; file, just above the &#8220;categories&#8221; section.</p>
<p><!--  This the new path to rotating affiliate banners  --></p>
<p><!--  This ends the path to rotating affiliate banners  --></p>
<p>3]  Last step is to build the &#8220;rotating_affiliates.php&#8221; code.  Create an array of your affiliate links, the form is;</p>
<p>&lt;?php</p>
<p>//  This section includes all the affiliate links and banners</p>
<p>$affiliate[1]=&quot;<a></a> &#8220;; </p>
<p>The usemap attribute scales a 300&#215;250 banner so it fits right in the available column space. Construct as many links as you want ;<br />
$affiliate[2]=<br />
$affiliate[3]=           etc.  I created 9 links for this site<br />
?&gt;<br />
Next you need code to randomize the links.  I chose to display 3 links at a time, and rotate them on refresh.  This code helps ensure that you don&#8217;t repeat any banner more than once in each refresh and ensures that the 3 banners displayed are not the same ones you displayed on the last refresh.</p>
<p><!-- Here's a non-repeating random number generator courtesy of <a href="http://www.phpbuilder.com" rel="nofollow">http://www.phpbuilder.com &#8211;></p>
<p>&lt;?php<br />
// Populate first 3 positions of a new array with the last instances of the displayed indexes</p>
<p>	for ($k=1; $k&lt;=3; $k++)<br />
		 {<br />
		$test_array[k]=$display_affiliate[$k];<br />
		 } </p>
<p>   $nonrepeatarray = array();<br />
   for($m = 1; $m &lt;=3; $m++) {<br />
      $rand = rand(1,9);</p>
<p>      //ensure value isn&#039;t already in the array<br />
      //if it is, recalculate the rand until we<br />
      //find one that&#039;s not in the array<br />
      while(in_array($rand,$nonrepeatarray)) {<br />
        $rand = rand(1,9);<br />
      }</p>
<p>      //add it to the array<br />
      $nonrepeatarray[$m+3] = $rand;<br />
   }</p>
<p>	for ($p=1; $p&lt;=3; $p++)<br />
		 {<br />
		$display_affiliate[$p]=$nonrepeatarray[$p+3];<br />
		 } </p>
<p> // This section displays the banners selected by the random number generator<br />
	for ($i=1; $i&lt;=$display; $i++)<br />
		 {<br />
		echo &quot;&#8221;.$affiliate[$display_affiliate[$i]].&#8221;";<br />
		 } </p>
<p>?&gt; </p>
<p>Hope you like this,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seo</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1074</link>
		<dc:creator>seo</dc:creator>
		<pubDate>Tue, 31 Jan 2012 17:33:54 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1074</guid>
		<description>Fantastic site you have here but I was curious about if you knew of any message boards that cover the same topics discussed here? I&#039;d really love to be a part of online community where I can get feed-back from other knowledgeable individuals that share the same interest. If you have any recommendations, please let me know. Bless you!</description>
		<content:encoded><![CDATA[<p>Fantastic site you have here but I was curious about if you knew of any message boards that cover the same topics discussed here? I&#8217;d really love to be a part of online community where I can get feed-back from other knowledgeable individuals that share the same interest. If you have any recommendations, please let me know. Bless you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: boudewijn Lutgerink</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1063</link>
		<dc:creator>boudewijn Lutgerink</dc:creator>
		<pubDate>Tue, 13 Dec 2011 12:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1063</guid>
		<description>Hi Chris,

While looking for a good theme for my new site I came across yours. This stuff looks great.
What I wonder about is if there is a possibility to add a URL to each individual image on the rotating header. That would give the possibility to show images of stuff one would sell and make the images clickable.</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>While looking for a good theme for my new site I came across yours. This stuff looks great.<br />
What I wonder about is if there is a possibility to add a URL to each individual image on the rotating header. That would give the possibility to show images of stuff one would sell and make the images clickable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lindsay</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1052</link>
		<dc:creator>Lindsay</dc:creator>
		<pubDate>Tue, 11 Oct 2011 17:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1052</guid>
		<description>Hey there, I just wanted to let you know our nonprofit wildlife and domestic rabbit rescue has been using your theme for a couple years now and we continually receive raving complements on how gorgeous our site is, despite the ads we put on it to generate a little extra income!  Excellent theme development, we could not be happier!  Thank you again!</description>
		<content:encoded><![CDATA[<p>Hey there, I just wanted to let you know our nonprofit wildlife and domestic rabbit rescue has been using your theme for a couple years now and we continually receive raving complements on how gorgeous our site is, despite the ads we put on it to generate a little extra income!  Excellent theme development, we could not be happier!  Thank you again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trish</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1041</link>
		<dc:creator>Trish</dc:creator>
		<pubDate>Mon, 22 Aug 2011 21:21:38 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1041</guid>
		<description>Hi,
I have a footer that is more than one line. I would like to center align or right align the footer. I&#039;ve seen lots of codes to do this but want to be sure that it works with your three column theme. Can you help?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have a footer that is more than one line. I would like to center align or right align the footer. I&#8217;ve seen lots of codes to do this but want to be sure that it works with your three column theme. Can you help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1040</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Fri, 19 Aug 2011 18:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1040</guid>
		<description>Awesome theme, keep up the good work!</description>
		<content:encoded><![CDATA[<p>Awesome theme, keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aquilah</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1037</link>
		<dc:creator>Aquilah</dc:creator>
		<pubDate>Sun, 24 Jul 2011 18:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1037</guid>
		<description>If I want to remove the borders from between the posts and sidebars, where do I change/delete the coding?  I can&#039;t seem to figure it out and it&#039;s the only change I haven&#039;t been able to make.</description>
		<content:encoded><![CDATA[<p>If I want to remove the borders from between the posts and sidebars, where do I change/delete the coding?  I can&#8217;t seem to figure it out and it&#8217;s the only change I haven&#8217;t been able to make.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Anstey</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1032</link>
		<dc:creator>Stephan Anstey</dc:creator>
		<pubDate>Thu, 12 May 2011 16:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1032</guid>
		<description>Wouldn&#039;t a count work better than hard coding the number in?

&lt;BLOCKQUOTE&gt;
$directory = $_SERVER[&#039;DOCUMENT_ROOT&#039;].&quot;/wp-content/themes/neoclassical/headers/&quot;;
$filecount = count(glob(&quot;$directory*.jpg&quot;));

$random_image = rand(1,$filecount); // the second number should equal the total number of images that you want to rotate
&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t a count work better than hard coding the number in?</p>
<blockquote><p>
$directory = $_SERVER['DOCUMENT_ROOT'].&#8221;/wp-content/themes/neoclassical/headers/&#8221;;<br />
$filecount = count(glob(&#8220;$directory*.jpg&#8221;));</p>
<p>$random_image = rand(1,$filecount); // the second number should equal the total number of images that you want to rotate
</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Redsun</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1030</link>
		<dc:creator>Redsun</dc:creator>
		<pubDate>Mon, 02 May 2011 00:05:15 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1030</guid>
		<description>Hi MG, I think you can make the header image clickable by using &lt;code&gt;&lt;a href rel=&quot;nofollow&quot;&gt;&lt;/code&gt; before the image and then close it with &lt;code&gt;&lt;/a&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi MG, I think you can make the header image clickable by using <code>&lt;a href rel=&quot;nofollow&quot;&gt;</code> before the image and then close it with <code>&lt;/a&gt;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MG</title>
		<link>http://www.pearsonified.com/theme/neoclassical/customize-random-header-images/comment-page-10/#comment-1028</link>
		<dc:creator>MG</dc:creator>
		<pubDate>Thu, 21 Apr 2011 02:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://pearsonified.com/theme/neoclassical/customize-random-header-images/#comment-1028</guid>
		<description>I have a question that may be answered above, but I couldn’t seem to find it. Is there a way to made the header clickable so it links back to the homepage? I’m using all the same images, so there isn’t a rotation.</description>
		<content:encoded><![CDATA[<p>I have a question that may be answered above, but I couldn’t seem to find it. Is there a way to made the header clickable so it links back to the homepage? I’m using all the same images, so there isn’t a rotation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

