• I’ve searched the docs and the forums, if not exhaustively, at least pretty thoroughly, so I regret if this has been asked and answered, or if it’s so obvious that it’s just bouncing off my head instead of sinking in.

    I’m content with the most recent posts first on my home page, but what I’d like is to be able to order the posts on my category pages to show the oldest post first.

    If this is possible, and if someone could just point me in the right direction, I’d be happy to fiddle with it on my own.

    https://www.laurelight.com/index.php if that’s helpful. I’ve still got the old site up under.html. FWIW, I’ve got Breukie’s Pages, Categories and Links widgets and the Sticky plugin. TIA

Viewing 7 replies - 1 through 7 (of 7 total)
  • This has been covered very many times already. Here’s one example.

    Thread Starter pbal

    (@pbal)

    Thanks, mahalie.
    I tried that in my category-template.php file, but it didn’t seem to work. Either something I messed up, or maybe my theme. I may try it again, just for giggles, but no matter. I sweated my way through the Category Templates page in the Codex and decided to add html above the posts to individual templates for each category. Looks like that’ll work. I really just wanted a different ‘sticky’ sort of thing for each category.

    And it’s all a learning experience. That php stuff, though…

    Thanks again.

    Yah, still working on the PHP thing myself. Managed to get Pages to display all their subpages. Haven’t tried the DESC instead of ASC for dates. You should look into custom query and keep searching…

    AndreSC

    (@andresc)

    for a ‘sticky sort of thing’ maybe try aStickyPostOrderER

    Kafkaesqui

    (@kafkaesqui)

    Custom Query String also provides one the ability to change sort order and method:

    https://www.transycan.net/blogtest/2007/10/30/custom-query-string-reloaded-for-wordpress-23-with-tag-support/

    Has anyone gotten oldest posts first to work in 2.3.2? I’ve TRIED the suggested
    <?php query_posts('order=ASC'); ?>

    (and others)…

    they don’t work. I’ve used both

    <?php query_posts('order=ASC'); ?>
    <?php query_posts('order=DESC'); ?>

    for my category.php file (before the loop) and it makes NO DIFFERENCE in the order which my two posts display. One is dated 12/01/2007 and the other 12/07/2007

    the one dated 12.07.2007 is displaying first in all cases. Again, this is in WordPress 2.3.2

    HMMM… on editing this… I looked in the db and the actual dates are 12.07.2007 and 11.31.2007 (which still means that the newest is displaying first, which is opposite of what I want). But nonetheless, using the query method suggested makes no difference, whether ASC or DESC. I am wondering if something about 2.3.2 is changed such that the method no longer works? if that is the case, HOW can order be reversed?

    Help is much appreciated!

    i’m using the ASC Outside The Loop which may be a little different than what you are looking for, but I’m providing this as a clue in case it’s any help as it’s used slightly differently than above and IS working with a fresh new installation of 2.3.3

    just before the Loop is called i’m using:

    <?php $posts = get_posts “order=ASC” ); ?>

    (well, I’ve stripped out the part that calls specific category and number of posts for simplicity)…

    and it’s working nicely. Don’t know if this helps you but hope it can be of some use.

    site is https://www.peytontochterman.com/ and you can see it on the Tour Dates pull on that home page: as I said, outside the Loop, but the order is ASC

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Order Posts in Categories’ is closed to new replies.