• Resolved ampersand

    (@ampersand)


    I’m sure there’s a simple way to do this, but I’ve been searching and having no luck.

    1) How can I create a category archive template for a theme that didn’t come with one? (I’m using a modified version of the “WordPress classic” theme that came with WordPress.)

    2) How can I reverse the order in the category archives, so instead of having the newest post on top, the oldest post will be on top and the newest will be on the bottom?

    This is for a blog I use to present the pages of my comic book (you can see the blog here). What I’d like is to be able to give readers the option of either reading the individual pages, or of reading a bunch of pages on the same webpage by scrolling down, from the earlier pages to the more recent pages.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Is this what you’re looking for?
    https://codex.www.ads-software.com/Category_Templates

    Doing some further research, I believe you can use a typical category.php (for your Category Template), then at the top (before your WordPress loop), use the WP_Query object to specify a new order. I haven’t tested, but I believe you would do it like so:

    $wp_query->set(“order”, “ASC”);

    More info here:
    https://codex.www.ads-software.com/Function_Reference/WP_Query

    Thread Starter ampersand

    (@ampersand)

    Thank you! Trying that didn’t work for me, but it did set me in the right direction.

    I realized that what I really want is for the entire blog – including all the categories and the main page – to present posts in chronological order, earliest on top (some people call this “chapter” order).

    What worked for me was editing the wp-blog-header.php file, and inserting this line:

    $order='ASC';

    Directly above this line:

    $wp_did_header = true;

    Thanks very much for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Earliest post on top in category archives?’ is closed to new replies.