function publish_later_on_feed($where) {
global $wpdb;
if ( is_feed() ) {
$time_now = gmdate('Y-m-d H:i:s');
$time_delay = '15'; // integer
$time_span = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
$where = " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$time_now') > $time_delay ";
}
return $where;
}
add_filter('posts_where', 'publish_later_on_feed');
// You can change the value of $delay to whatever length of time suits you.
Have you ever published a post and then realised there was a huge mistake in the first paragraph? It’s easy enough to fix the error, but it’s too late for all your subscribers – your post has already been published in their RSS feeds.
Delay when your posts are published to RSS and give yourself time to double-check your live posts. Add this snippet to your functions.php file
Delay when your posts are published to RSS and give yourself time to double-check your live posts. Add this snippet to your functions.php file
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.