WordPress.org

Forums

Update Post with Date (9 posts)

  1. AnimaliX
    Member
    Posted 5 years ago #

    Hi , ALL :)
    I need update DATE of POST to actual automatically with update post ...
    what need change for it, please ?

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Try editing your theme files and replacing <?php the_date();?> with <?php the_modified_date();?> and <?php the_time();?> with <?php the_modified_time();?>

    http://codex.wordpress.org/Function_Reference/the_modified_date
    http://codex.wordpress.org/Function_Reference/the_modified_time

  3. AnimaliX
    Member
    Posted 5 years ago #

    I testing this on default Twenty Ten 1.1 and only in archive, attachment and functions.php have something with "date".

    default date/time format in functions.php is:

    function twentyten_posted_on() {
    ...some code...
    esc_attr( get_the_time() ),
    get_the_date()

    and change into:

    function twentyten_posted_on() {
    ...some code...
    esc_attr( get_the_modified_time() ),
    get_the_modified_date()

    but with no changes on web :(

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    Remember to press CTRL and F5 simultaneously when viewing an updated page/site. Or try emptying your browser cache. This should ensure that your web browser fetches a fresh copy of the page rather than serving up an out-dated copy from your own cache.

    Also disable/deactivate any caching plugin(s).

  5. AnimaliX
    Member
    Posted 5 years ago #

    i testng all on online server and in my local private server (basic WP witn no plugins) ...and with no luck :(

  6. esmi
    Forum Moderator
    Posted 5 years ago #

    The code changes you've posted should work. Have you actually updated any posts since you made the changes?

  7. AnimaliX
    Member
    Posted 5 years ago #

    i create two test posts:

    TEST02 - "Published on: Aug 18, 2010 @ 23:09" (Last edited is same)
    TEST01 - "Published on: Aug 18, 2010 @ 22:44" BUT "Last edited by admin on August 18, 2010 at 23:12"

    on website is TEST02 still in first place :(

  8. esmi
    Forum Moderator
    Posted 5 years ago #

    The default listing order won't change as that's based on the original publication date - not the modified date. If you wanted to modify the listing order, you'd need to add a custom query to the relevant template file(s) based on the modified date.

  9. AnimaliX
    Member
    Posted 5 years ago #

    i find plugin "Custom Post Order"

Topic Closed

This topic has been closed to new replies.

About this Topic