Support » Fixing WordPress » Order by arbitrary date

  • Resolved zachalbert

    (@zachalbert)


    Hi, I am converting a static website to a wordpress site, and one feature on the site is a lot of weekly postings that go back a couple of years.

    All these posts have to make it into the database to be displayed in chronological order. However, the default orders them by chronological order for the <i>post date</i>. So I thought about ordering it alphabetically by the title, but this quickly turns the title into something ugly:

    <?php $posts=query_posts($query_string . ‘&orderby=title&order=des’);
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    I can only get it to work with a title like, “2008-09-10 Post Title.”

    I would like something a little more readable, like “September 10th, 2008 – Post Title.” But then the months screw everything up.

    Going back from the beginning and entering them chronologically isn’t an option either. By the time they were all entered, I’d have an extra 2 months to catch up on, and if they ever want to post even OLDER stuff, then I’m screwed.

    Is there a way to do this? Other than copying/pasting from the codex, I’m not real strong with MySQL/PHP, so please use simple explanations!

Viewing 3 replies - 1 through 3 (of 3 total)
  • WordPress allows you to change the post date once posts have been entered. Thus you can arrange them chronologically as you please, after the fact, which allows your posts to appear in whatever order you want. You can change the dates directly in the database if you want to, which would be much faster

    Thread Starter zachalbert

    (@zachalbert)

    Oh, thanks a lot, that totally works!

    >Wordpress allows you to change the post date once posts have been entered. Thus >you can arrange them chronologically as you please, after the fact, which allows your >posts to appear in whatever order you want.

    How does this work? do I have to go and edit them in the order I want them to appear?

    Jaime

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order by arbitrary date’ is closed to new replies.