Don’t you hate it when there’s an error in your blog post or you mistakenly click “Publish” before you’re finished?
You quickly jump back into your admin to make the changes or revert to “Save Draft,” and although it’s been changed on your blog, the erroneous blog post has already been sent to your RSS feed.
Sad panda 🙁
Here’s a little WordPress snippet that can give you a little breathing room between your published post and your updated RSS feed:
How-To Adjust Your WordPress RSS Feed Publishing Time
You can easily add this snippet to your theme’s functions.php file, but I would recommend dropping this into it’s own functionality plugin or adding it to some other functions you may be using that’s not connected directly with your WordPress theme.
Here’s the codeness:
[cc lang=”php”]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 = ’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-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’);[/cc]
This sets it to ten minutes, but you can adjust it how you see fit!
[via wpbeginner]
Speak your mind...