Home / rss / Delay RSS feed
  • How to Delay RSS feed

    no thumbnail sorry: Delay RSS feed

    Adding this to your functions.php file will delay your posts to RSS feed. This is a good way to fix mistakes before they are published to your feed.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    function publish_later_on_feed($where) {
    	global $wpdb;
    	if ( is_feed() ) {
    		$now = gmdate('Y-m-d H:i:s');
    		// value for wait; + device
    		$wait = '5'; // integer
    		$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
    		$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
    	}
    	return $where;
    }
    add_filter('posts_where', 'publish_later_on_feed');
    

    ( WordPress codex functions, hooks, in this snippet. )

    posts_where, add_filter, is_feed, wp,
  • Laura

    Can I use this to delay the posting of the topic feed from bbpress?
    Thanks!