WordPress.org

Support

Support » How-To and Troubleshooting » Update Post with Date

Update Post with Date

  • Hi , ALL 🙂
    I need update DATE of POST to actual automatically with update post …
    what need change for it, please ?

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi

    @esmi

    Forum Moderator

    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

    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 🙁

    esmi

    @esmi

    Forum Moderator

    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).

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

    esmi

    @esmi

    Forum Moderator

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

    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 🙁

    esmi

    @esmi

    Forum Moderator

    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.

    i find plugin “Custom Post Order”

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Update Post with Date’ is closed to new replies.
Skip to toolbar