WordPress.org

Ready to get started?Download WordPress

Forums

Reverse order listing? Events calender? (13 posts)

  1. everth
    Member
    Posted 9 years ago #

    Can I change the order in which the listings in the blog appear from latest post on top to oldest post on top?
    This would be handy in some instances.
    Related: Has anybody made a hack that would ad a "relevant date" to each post and list posts according to these?
    This would be cool as you could use a category in your blog to list "Events" which have a date and which are sorted as such in the blog. Call it Events Calendar.
    You could then use the blog to schedule things or alert your readers to future important things in sequence or write about anything else temporal which needs to be displayed in that order.

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Event Calendar
    http://blog.mookitty.co.uk/archives/2004/05/28/event-calendar
    and yes, the order can be changed - a search should turn that up ?

  3. everth
    Member
    Posted 9 years ago #

    Thanks! No, search missed that one. I got a threat on some stuff but this seem just right.
    Cheers!

  4. Anonymous
    Unregistered
    Posted 9 years ago #

    I can't turn anything up on a search either. Have tried 'reverse order posts', 'posts ascending', 'posts descending', 'old posts first'... any other suggestions?

  5. Anonymous
    Unregistered
    Posted 9 years ago #

    scratch that, I tried 'chronological' and it seems the question has been asked before with no answer, so I guess it can't be done :(

  6. Mark (podz)
    Support Maven
    Posted 9 years ago #

    I'm sure I've seen this answered before ...... I'm searching too...

  7. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Found this from Matt:
    "One benefit to a completely dynamic system is that you can change views on the fly pretty easily. So if the reverse chronological thing bothers you that much, at least with WordPress blogs you have a easy fix. Simply add ?order=asc to any WordPress URI and it will order the dates ascending instead of descending. "
    So somewhere in the code, the order is set.. but where ?
    I haven't got a 1.2.1 / 1.2 install to play with on this - I'll go look.

  8. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Ah-ha!
    Caveat#1: I tried this on a local install of 1.2, but it worked.
    Caveat#2: Backup the file you alter first - don't trust me, I'm no coder :)
    file: wp-blog-header.php
    lines: 342-343
    They say this:
    if ((empty($order)) || ((strtoupper($order) != 'ASC') && (strtoupper($order) != 'DESC'))) {
    $order='DESC';
    }

    Change it to this:
    if ((empty($order)) || ((strtoupper($order) != 'ASC') && (strtoupper($order) != 'DESC'))) {
    $order='ASC';
    }

    Please do backup your file first though, and I've tested for nothing else this may or may not do ! I have no idea what else this may affect, so keep the back file just in case.

  9. Anonymous
    Unregistered
    Posted 9 years ago #

    I know options are eeevil, but if it's a choice between providing an option and forcing people to hack core files I wish they'd go with the option. Just my $0.02. Thanks anyway Podz.

  10. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Maybe so, but I wouldn't call this an 'option', more of an 'idiosyncrasy' - there aren't a lot of people asking for this at all, and options - I feel - should be there for the more popular choices.
    Either way, the answer is here now.
    What I would do is do the ?order=DESC on your home url so that it shows the 'right' way around then bookmark that link - it's an easy way to then see your most recent post.

  11. damino
    Member
    Posted 8 years ago #

    Hello do someone knows how to do with the last WordPress version ?
    I mean to have an antechronological listing for one particular category ?

    Thanks

  12. Pete2b
    Member
    Posted 8 years ago #

    In the newest version of WordPress, wp-blog-header.php does not seem to contain to code needed to alter

    if ((empty($order)) || ((strtoupper($order) != 'ASC') && (strtoupper($order) != 'DESC'))) {
    $order='DESC';

    I've searched for the answer, but I keep ending up back at this thread.

    Any help please?

  13. Pete2b
    Member
    Posted 8 years ago #

    I'll answer my own post, if I may

    I found it here eventually

    http://wordpress.org/support/topic/2330?replies=11

    It took some finding though.
    Is there anyone around who could write a plugin to add a button on the page so that the comments could be toggled between ascending and descending? Think of the glory!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags