Support » Plugins » Hacks » order by first modified date

  • 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

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

    (@esmi)

    Forum Moderator

    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

    esmi

    (@esmi)

    Forum Moderator

    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.

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

    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

    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.

    Sounds trouble. Thanks again.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘order by first modified date’ is closed to new replies.