WordPress.org

Ready to get started?Download WordPress

Forums

Post-dated posts never go live. (9 posts)

  1. AMSmith
    Member
    Posted 7 years ago #

    If I set a date in the future for a post, and then publish it, it will only go live if I go BACK to the admin area and re-publish it.

    I thought you were supposed to be able to use the date to schedule articles to go live, but it doesn't work.

    Any ideas?

  2. JRGould
    Member
    Posted 6 years ago #

    I'm having this same problem. It just started when I moved my blog to new hosting. Could it be a permissions issue?

  3. MichaelH
    Member
    Posted 6 years ago #

    Not seeing the problem at 2.3.1. Have you considered upgrading?

  4. JRGould
    Member
    Posted 6 years ago #

    Oh, I should have mentioned that. I am running 2.3.1, and post-dating was working before I moved to the new server setup.

  5. MichaelH
    Member
    Posted 6 years ago #

    Check the "Times in the blog should differ by:" in Options->General.

    Also if it happens again, it would be interesting to know the post_date and post_date_gmt in wp_posts.

  6. JRGould
    Member
    Posted 6 years ago #

    so here's where it gets interesting. Here's a print_r of a post made at 8:30AM timestamped for 8:35AM and accessed at around 8:40AM

    stdClass Object
    (
        [ID] => 1388
        [post_author] => 1
        [post_date] => 2007-11-28 08:35:28
        [post_end_date] =>
        [post_date_gmt] => 2007-11-28 16:35:28
        [post_content] => Lorem ipsum dolor sit amet...
        [post_title] => Post-dated post
        [post_category] => 0
        [post_excerpt] =>
        [post_status] => future
        [comment_status] => open
        [ping_status] => closed
        [post_password] =>
        [post_name] => post-dated-post
        [to_ping] =>
        [pinged] =>
        [post_modified] => 2007-11-28 08:35:28
        [post_modified_gmt] => 2007-11-28 16:35:28
        [post_content_filtered] =>
        [post_parent] => 0
        [guid] => http://thedistrictweekly.com/backend/uncategorized/2007/11/28/post-dated-post/
        [menu_order] => 0
        [post_type] => post
        [post_mime_type] =>
        [comment_count] => 0
    )
    
     current time:2007-11-28 8:40:07

    where it gets weirder is that when I checked the dashboard at around 8:34 it said:

    Scheduled Entries:
    
        * Post-dated post in 1 min

    and when I checked it again at 8:40 it said:

    Scheduled Entries:
    
        * Post-dated post in 5 mins

    So it actually started counting up again

    in the dump of $post you'll notice:

    [post_status] => future
    [post_date] => 2007-11-28 08:35:28
    [post_date_gmt] => 2007-11-28 16:35:28

    even though the time (printed with date()) is
    current time:2007-11-28 8:40:07

    so, I'm stumped. The part where dashboard is counting up is actually almost comical. It's now 8:47 and dashboard says:

    Scheduled Entries:
    
        * Post-dated post in 12 mins

    any ideas?

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    any ideas?

    Yes. Your WP-Cron is not working on the new host. It's a problem with the host being unable to connect back to itself, for whatever reason.

    WP-Cron works by making an fsockopen call back to itself (wp-cron.php specifically), which triggers lots of various events. Making future posts publish is one of those events.

    Since WordPress can't trigger WP-Cron to work, the posts never publish. Also, pings and trackbacks won't work.

    The simple solution is to figure out what's broke on the new host. Does it not have DNS set up properly? Can it not resolve it's own domain name? Does it not allow fsockopen? Does it have a firewall blocking connections from itself? Could be anything.

    As a temporary workaround, you can manually force WP-Cron to run. Edit the wp-cron.php file, and remove this code:

    if ( $_GET['check'] != wp_hash('187425') )
    	exit;

    (note, you'll want to add it back afterwards, so keep a copy of the file).

    Next, in a browser, load your own site's wp-cron.php manually, like so: http://example.com/yoursite/wp-cron.php

    That will allow wp-cron to run and take care of stuff. You may have to run it multiple times if it has a lot to do.

    In the meantime, ask your host why their webservices are broken.

  8. JRGould
    Member
    Posted 6 years ago #

    ahh thanks, this is starting to make sense. Unfortunately I'm on an unmanaged virtual dedicated server. So I guess the hard bit is up to me. Do you know if there is a way I can get some error information so I can troubleshoot this?

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Mmmmm.. Not really. You could look at the apache logs, see if there's any errors in there. I really have never been able to reproduce the problem myself. I install Apache and PHP and it "just works" when I do it.

Topic Closed

This topic has been closed to new replies.

About this Topic