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.
- The topic ‘sorting posts’ is closed to new replies.