Organising WordPress Archives Alphabetically Question
Written By Ollie on Mar. 22, 2008.
2 Comments
Report Note
+ Clip This
A quick question for the WordPress/PHP/MySQL gurus among us:
How would I go about organising my category view so that when I click on a category and get taken to ..mydomain/category/asides/, the posts are shown in alphabetical order according to the first letter(s) in the title/permalink?
It probably sounds like a "huh?" question, but I have a reason for wanting to know if this is possible, and if so, how.
(Must have mis-clicked the community, feel free to move.)

leliathomas
Written Mar. 22, 2008 / Report /
Try...
<?php $my_catposts = new WP_Query('category_name=CATEGORYNAMEHERE&showposts=10&orderby=name'); ?><?php while($my_catposts->have_posts()) : $my_catposts->the_post(); ?>
<ul>
<li><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
</ul>
<?php endwhile; ?>
Ordering by name works in post queries. Probably an easier way, even.
Ollie
Written Mar. 22, 2008 / Report /
Thanks Lelia. :)