Skip to content

Instantly share code, notes, and snippets.

@pragmatic-web
Created March 2, 2012 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pragmatic-web/1958240 to your computer and use it in GitHub Desktop.
Save pragmatic-web/1958240 to your computer and use it in GitHub Desktop.
Add future-dated posts to a WordPress feed
/* Add future posts to RSS feeds */
function include_future_posts($where) {
global $wpdb;
if ( is_feed() ){
// add SQL-syntax to default $where
$where .= " OR $wpdb->posts.post_status = 'future' " ;
}
return $where;
}
add_filter('posts_where','include_future_posts');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment