<?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>WpFunc &#187; 15 days old</title>
	<atom:link href="http://wpfunc.com/tag/15-days-old/feed" rel="self" type="application/rss+xml" />
	<link>http://wpfunc.com</link>
	<description>Awesome, Quick, Simple WordPress Functions!</description>
	<lastBuildDate>Thu, 01 Dec 2011 01:17:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Show your ads on only old posts!</title>
		<link>http://wpfunc.com/wordpress/show-your-ads-on-only-old-posts.html</link>
		<comments>http://wpfunc.com/wordpress/show-your-ads-on-only-old-posts.html#comments</comments>
		<pubDate>Wed, 09 Dec 2009 12:24:25 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[15 days old]]></category>
		<category><![CDATA[ads]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[Google adsense]]></category>
		<category><![CDATA[old posts]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=315</guid>
		<description><![CDATA[We use Google Adsense or any other ad servers for make money :) You can use this ads on your old posts. I don&#8217;t know any pluginfor that function but we can make a function for use ads&#8230; Let&#8217;s begin&#8230;
Here is the code;
To use this code open your functions.php and paste this code into end [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">We use Google Adsense or any other ad servers for make money :) You can use this ads on your old posts. I don&#8217;t know any pluginfor that function but we can make a function for use ads&#8230; Let&#8217;s begin&#8230;<span id="more-315"></span></p>
<h3 style="text-align: justify;">Here is the code;</h3>
<p style="text-align: justify;">To use this code open your <strong><span style="color: #ff0000;">functions.php</span></strong> and paste this code into end of file.</p>
<pre class="brush: php; title: ; notranslate">function is_old_post($post_id=null){
   $days = 15;
   global $wp_query;
   if(is_single() || is_page()) {
      if(!$post_id) {
         $post_id = $wp_query-&gt;post-&gt;ID;
      }
      $current_date = time();
      $offset = $days *60*60*24;
      $post_id = get_post($post_id);
      $post_date = mysql2date('U',$post_id-&gt;post_date);
      $cunning_math = $post_date + $offset;
      $test = $current_date - $cunning_math;
      if($test &gt; 0){
         $return = true;
      }else{
         $return = false;
      }
   }else{
      $return = false;
   }
   return $return;
}
</pre>
<p>After that use this code for show your ads&#8230;</p>
<pre class="brush: php; title: ; notranslate">&lt;?php if(is_old_post()){ ?&gt;
INSERT AD CODE HERE
&lt;?php } ?&gt;
</pre>
<p>This function show ads on your <strong>15 days old</strong> posts. To change this simply change <em><strong>$days </strong></em>value</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/show-your-ads-on-only-old-posts.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

