<?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; time</title>
	<atom:link href="http://wpfunc.com/tag/time/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>Delay your feed updates</title>
		<link>http://wpfunc.com/wordpress/delay-your-feed-updates.html</link>
		<comments>http://wpfunc.com/wordpress/delay-your-feed-updates.html#comments</comments>
		<pubDate>Thu, 01 Jul 2010 07:47:49 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[delay]]></category>
		<category><![CDATA[delay time]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[publish time]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=454</guid>
		<description><![CDATA[You can set the feed update time with a simple function. The only need you have to edit your theme&#8217;s functions.php. Let&#8217;s Begin.
Here is the code;
With this code update will wait for 5 minutes. You can chnge this time period. Just change $wait value for this.
That&#8217;s All. Have a nice day.
]]></description>
			<content:encoded><![CDATA[<p>You can set the feed update time with a simple function. The only need you have to edit your theme&#8217;s functions.php. Let&#8217;s Begin.<span id="more-454"></span></p>
<h3>Here is the code;</h3>
<pre class="brush: php; title: ; notranslate">// delay feed update
function publish_later_on_feed($where) {
	global $wpdb;

	if (is_feed()) {
		// timestamp in WP-format
		$now = gmdate('Y-m-d H:i:s');

		// value for wait; + device
		$wait = '5'; // integer

		// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
		$device = 'MINUTE'; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

		// add SQL-sytax to default $where
		$where .= &quot; AND TIMESTAMPDIFF($device, $wpdb-&gt;posts.post_date_gmt, '$now') &gt; $wait &quot;;
	}
	return $where;
}
add_filter('posts_where', 'publish_later_on_feed');</pre>
<p>With this code update will wait for 5 minutes. You can chnge this time period. Just change <span style="color: #ff0000;"><strong>$wait</strong></span> value for this.<br />
That&#8217;s All. Have a nice day.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/delay-your-feed-updates.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add an expration date for posts!</title>
		<link>http://wpfunc.com/wordpress/add-an-expration-date-for-posts.html</link>
		<comments>http://wpfunc.com/wordpress/add-an-expration-date-for-posts.html#comments</comments>
		<pubDate>Sun, 19 Jul 2009 07:00:25 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[expration]]></category>
		<category><![CDATA[Loop]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=52</guid>
		<description><![CDATA[If you want to add an expration date to your posts you have to change your WordPress&#8217; Loop area. This is not delete your posts, only turns to draft. When you change Loop area you will able to add an expration date with custom fileds. This is very simple function/recipe.Firstly you have to change your [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">If you want to add an expration date to your posts you have to change your WordPress&#8217; Loop area. This is not delete your posts, only turns to draft. When you change Loop area you will able to add an expration date with custom fileds. This is very simple function/recipe.<span id="more-52"></span>Firstly you have to change your <strong><em>Loop</em></strong><span style="color: #ff0000;"> <span style="color: #000000;">area. You have to change your theme files for this.</span><em><strong> </strong></em></span><span style="color: #ff0000;"><em><strong>Every Loop area must change.</strong></em></span></p>
<p>Change your <em><strong>Loop</strong></em> area wtih this code.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;?php
if (have_posts()) :
     while (have_posts()) : the_post(); ?&gt;
         $expirationtime = get_post_custom_values('expiration');
         if (is_array($expirationtime)) {
             $expirestring = implode($expirationtime);
         }

         $secondsbetween = strtotime($expirestring)-time();
         if ( $secondsbetween &gt; 0 ) {
             // For example...
             the_title();
             the_excerpt();
         }
     endwhile;
endif;
?&gt;
</pre>
<p style="text-align: justify;">After apply this code you can add a custom filed, the name of custom filed is <em><strong><span style="color: #ff0000;">expration</span></strong></em>. The custom fileds value must be like <strong><span style="color: #ff0000;">mm/dd/yyyy 00:00:00</span></strong>.</p>
<p style="text-align: justify;">That&#8217;s All! Have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/add-an-expration-date-for-posts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

