Advertisement

Show future posts in Wordpress 2.3+

To enable Wordpress to show and publish future posts…BEFORE creating future posts (or if you have already created posts – reedit the timestamp in Admin > Manage > Posts). In the file /wp-includes/post.php look for the section:

if ( 'publish' == $post_status ) {
  $now = gmdate('Y-m-d H:i:59');
  if ( mysql2date('U', $post_date_gmt) > mysql2date('U', $now) )
 $post_status = 'future';
 }

change this to:

if ( 'publish' == $post_status ) {
  $now = gmdate('Y-m-d H:i:59');
  if ( mysql2date('U', $post_date_gmt) > mysql2date('U', $now) )
 //hack to show future posts
 $post_status = 'publish';
 }

That worked for me on Wordpress 2.3.3

VN:F [1.4.8_745]
Rating: 0.0/10 (0 votes cast)

Tags: , , ,

Socialize This Post

DeliciousDiggFacebookRSS FeedStumbleUponTwitter

11 Responses to “Show future posts in Wordpress 2.3+”

  1. Skippy Says:

    It works, but generally you should not modify core WP files or you’ll run into trouble when it’s time to upgrade.

    Here’s a 1-line solution which you can put in your theme in index.php and archive.php. Add it at the top:

    query_posts($query_string.’&post_status=publish,future’);

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  2. Jason Says:

    Skippy’s solution will display the post on the index and archive pages, but it will not allow the post to be viewed directly from the single.php template. That is the problem I’m running into.

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  3. using wordpress as a calendar for the future - WebProWorld Says:

    [...] Re: using wordpress as a calendar for the future If you haven’t already come across this: Arkytek Ltd :: Blog

  4. Johan Says:

    Hi!

    Is this a solution to actually show future posts in Wordpress? I want to be able to show future posts and use Wordpress as an event/calender publishing system, found a plugin called “eventcalendar” but it doesn’t seem to work in WP2.5.

    Skippy: Im not that good in php, could you explain exactly where in the code to place your solution?

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  5. mores Says:

    thanks skippy, your solution was just what I needed. And I don’t need to view future posts in full in my layout, just a mention.
    Excellent, thank you very much!

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  6. Michael Says:

    Excellent work .. thanks for this. cheers

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  7. ems Says:

    this does not work for me :(

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  8. mores Says:

    Well guess what … I now need to show future posts in single view – sort of an event based system.
    Any solutions on fixing the bug where you can’t view detailed future posts?

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  9. mssmotorrd Says:

    It’s the first time I commented here and I must say you share us genuine, and quality information for bloggers! Good job.
    p.s. You have a very good template for your blog. Where did you find it?

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  10. adadmin Says:

    I use wordpress and created a template from the default theme, thanks for your comment

    VN:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)
  11. ugi Says:

    try this guys: http://webdemar.com/wordpress/display-future-posts-in-your-wordpress-theme/

    VA:F [1.4.8_745]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply