There are times when you publish a post and suddenly find an error. You can go back in the admin panel and change it, but it is
already published in the feeds. With this hack, you can put a delay of as many minutes as you like, so you can double check the post live.
Simply open your functions.php and add the following code in there:
01 | function publish_later_on_feed( $where ) { |
06 | $now = gmdate ( 'Y-m-d H:i:s' ); |
15 | $where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait " ; |
20 | add_filter( 'posts_where' , 'publish_later_on_feed' ); |
Change the time from 10 minutes to whatever you like.
If terms like
feed,
syndication, and
RSS make your head spin, stop right now and read an
Introduction to Syndication. That will give you a
good overview of feeds and syndication. We have an article on
WordPress Feeds to help you understand the basics, if you need them, but from here on, this article assumes that you know the basics of what feeds are and how they are used.
Customized feeds give your readers more information about you and your blog: you can include the names of additional collaborators on your blog posts, or a link to your Friend-of-a-Friend file. Contrariwise, it can also help you restrict the information available for syndication, by removing extraneous data or providing a machine-readable version of your copyright statement.
No comments: