Personally, I am sick and tired of the United States government meddling more and more in our lives. The movie and music industry is using our elected officials like puppets (muppets) and we are sitting idly by and letting it happen. Well, I signed the petition, and my voice will be heard next election. G.R.I.P. – Get Rid of Incumbent Politicians. If we really want to make changes, we have to get those that pander to big business out of office and let them know that we have the power to do it. After all, they are there to represent Read More…
Delaying your WordPress RSS Feed
Date: August 11th, 2010
Author: Joe DiFiglia
Category: Wordpress
Tags: functions.php, Wordpress
Article URL: http://computingondemand.com/?p=4142
I can't tell you how many times I have written an article, hit publish, then realized that I made some mistakes. It doesn't matter how much I proofread a post, it happens all the time. With that, our readers get these articles delivered to them through my feed. Wouldn't it be nice if I could delay the feed a bit, just in case I have to make a change? Well, you can... and this is how.
The code below will delay your feed for 30 minutes. You can change the time it takes by editing the integer and designating the time in minutes, hours, days, etc.
1. edit your theme's functions.php file
2. paste the following code between the <?php and the ?>
//--------------------------------------------------------------------------
// Start Delay Feed
// --------------------------------------------------------------------------
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 = '30'; // 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 .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter('posts_where', 'publish_later_on_feed');
// --------------------------------------------------------------------------
// End Delay Feed
// --------------------------------------------------------------------------Note: These functions are not of my own creation, simply things I have found along the way. If you are the author of this function, please let me know so I can properly credit you with your work!


