WordPress.org

Forums

order by first modified date (8 posts)

  1. rumlab
    Member
    Posted 5 years ago #

    Hi.
    Is there a way to sort posts by first modified date instead of last? I don't want to use post date, as I am showing future posts in my theme.
    I would also like to be able to show the first modified date.

    Best,
    Morten

  2. esmi
    Forum Moderator
    Posted 5 years ago #

  3. rumlab
    Member
    Posted 5 years ago #

    Hi esmi - thanks for the pointer. I have been through that a couple of times, and maybe I'm overlooking something, but I don't see how to target the first modified date / first revision.

    Also, about showing the date, I am using this to show when and who:

    <small><b><?php the_modified_date('Y.m.d'); ?></b> <i>af <?php the_author_posts_link(); ?></i></small>

    but that will give me the last modefied date.

    Best,
    Morten

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    You're right - you can only list by modified date (which, I assume, will be the last modified date). My guess is that you'll need to construct your own sql query to list by first modified date.

  5. Mark / t31os

    Posted 5 years ago #

    The database does not hold data on the first modified date, only the most recent(or last) time of modification.

    http://codex.wordpress.org/Database_Description#Table:_wp_posts

    The modified field/column is updated each time a given post is, but there's no such data on the first modified time (unless you've only modified a post once of course).

  6. rumlab
    Member
    Posted 5 years ago #

    Ok I see, thank you for the explanation. So how does wordpress hold the information about revisions? I mean, they are so easily accessible from the admin area, and can even be restored.

    M

  7. Mark / t31os

    Posted 5 years ago #

    Well sure there's exception to revisions, and you could possibly use those as a means to determining modification times, but they are flushed out at certain intervals, so they'll not be totally accurate, because there's always the chance the first revision no longer exists.

  8. rumlab
    Member
    Posted 5 years ago #

    Sounds trouble. Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic