Support » Fixing WordPress » sorting posts

  • I have a template that displays posts of a certain category. I want the posts to appear not in chronologic order, but in numeric order like Lesson 1, Lesson 2, Lesson 3, etc. I inserted the code:
    <?php global $query_string; query_posts($query_string . “&orderby=title&order=asc”); ?>
    in the template which works but only up to Lesson 9. Lesson 10 is placed before Lesson 2 because it sees the digit 1 in 10 as coming before 2. This is a problem … I could rename the posts like Lesson A, Lesson B, Lesson C, etc, but I would rather not. Any suggestions?
    I would appreciate any ideas.
    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • What about ordering post by date and then orderby asc assuming that the first post you posted was Lesson 1 through to 10 …

    Yes that would work but If I want to update a post and repost it it would have the wrong sequence.

    Thank you, Colin, you gave me an idea. It’s not my preferred solution, but it would do for now. I don’t need to delete a post to update it, simply remove it’s Flash content, update it, and replace it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘sorting posts’ is closed to new replies.