• Resolved 2matte

    (@2matte)


    Hi,

    I recently installed my first wp blog for a client, and now we’ve run into a strange problem; our posts don’t order correctly according to date.

    I’ve tried reinstalled a blank version of wp using the default theme, but still it behaves the same. Only thing we haven’t done is to clear the whole database and start from scratch, but before doing that I thought I’ll write a post here to see if someone has a clue why this is happening.

    We’re using v 2.0.4, and our blog can be found here (please note the ordering of the posts on the main page): http://www.dowlingdesign.co.uk/blog/

    Any help or feedback will be greatly appreciated!

    Thanks
    Henrik

Viewing 5 replies - 1 through 5 (of 5 total)
  • Nice site!

    Strange about the order. I tried to find a pattern but couldn’t. I did notice that category archives display correctly, but the monthly didn’t and neither did the index.

    Have you looked at query_posts?
    http://codex.ww.wp.xz.cn/Template_Tags/query_posts

    Very easy and powerful: open the index.php for example and replace

    <?php get_header(); ?>(this is found on line 1)

    with

    <?php
    get_header();
    query_posts(‘order=DESC’);
    ?>

    This will list the posts in chronological order. Use order=ASC if you want to go the other way. Now, this is supposed to be the default that WP uses but what do we know. Sometimes things are screwy.

    If this works you’ll need to paste it into a few different files: index, archive, archives, and search I guess; depends on the theme you’ve created.

    Hope this helps.
    /Colin

    Thread Starter 2matte

    (@2matte)

    Thank you so much for your reply Colin,

    Unfortunately this didn’t fix it; the pages still show up in the same strange order. And as you said, there’s no apparent logic to it, except that after the post that now shows up on top, the posts seem to order in ascending order.

    Could it be something with the database?

    Hmm, could be.

    I think you should talk to your server support. Explain what’s going on and ask if it’s something with how MYSQL is querying the database.

    I don’t think you need to clear the db and start over, though! At least I hope not. 🙁
    The problem probably lies elsewhere.

    /Colin

    Thread Starter 2matte

    (@2matte)

    Thanks again,

    Actually now i’m pretty sure it’s something with the database after doing a few tests.

    1. I connected the client’s blog to the databaser of my own test blog: Everything works as it should, all new posts sorted in decending order.

    2. I set up a new installation on the clients database using a new table prefix (wp2 instead of wp1): Doesn’t work as it should, all posts are now sorted in ascending order again.

    Also note that no other file except wp-config has been changed.

    I’ve asked the client to contact his ISP, so now i’m waiting to see what they’ve got to say.

    Best
    Henrik

    Thread Starter 2matte

    (@2matte)

    Working now after talking with the ISP, so i assume it was something at their side.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Order by date not working’ is closed to new replies.