WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Order by arbitrary date (4 posts)

  1. zachalbert
    Member
    Posted 5 years ago #

    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!

  2. stvwlf
    Member
    Posted 5 years ago #

    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

  3. zachalbert
    Member
    Posted 5 years ago #

    Oh, thanks a lot, that totally works!

  4. joliverl
    Member
    Posted 5 years ago #

    >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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags