![]() |
Finally, I like to delay posting to my RSS feeds for 10-15 minutes because I always find at least a couple errors in my text. Other uses are in case you want content to be exclusive to your site for a day or a week before pushing it out to your RSS readers. |
Example:
PHP
// Delay feed update
function publish_later_on_feed($where) {
global $wpdb;
if (is_feed()) {
// Timestamp in WordPress format
$now = gmdate('Y-m-d H:i:s');
// Value for wait; + device
$wait = '10'; // 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 syntax to default $where
$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter('posts_where', 'publish_later_on_feed');
How to Delay the public posting to RSS Feed | Wordpress RSS Shortcode |
Delay the public posting to RSS Feed | Wordpress RSS Shortcode |
Read Full: | Wordpress RSS Shortcode |
Category: | Web Tutorial |
Sub Category: | Wordpress RSS Shortcode |
Uploaded by: | Admin |
Views: | 82 |
Tested on: | WordPress 3.0.1 |