my site lists entries which are posts i have laoded under various categories
the list of all posts can be seen at http://www.yachtprovisioningservice.com/?page_id=39
then if you click on the category links it lists the posts that were loaded with these categories selected.
at present these lists of posts are appearing in date order as i have laoded them but i want the posts to apepar in alphabetical order isntead of by date loaded order.
eg go to page http://www.yachtprovisioningservice.com/?page_id=39
click the '•Western Mediterranean (5) ' link
this shows the posts under this category by post title but not in alphabetical order. this is what i wnat to change]
]thanks!
Add before the loop call!
<?php query_posts($query_string . "orderby=title"); ?>
Example Twenty Ten category.php
query_posts($query_string . "orderby=title");
get_template_part( 'loop', 'category' );
Other themes:
<?php query_posts($query_string . "orderby=title"); ?>
<?php if( have_posts() ) : ?>
HTH
David
thanks.. which file do i edit?
this is the simplicity theme not twenty ten.
sorry for my ignorance here..
need to know which file to edit
thanks!
It would be category.php or archive.php, but only do this on a test site first and if you have FTP, if you mess up the php code using the WordPress > Admin > Appearance > Editor you will lock yourself out, with a fatal error message.
David
ok thanks. will try boith
if i lock it i can always ftp the original file from the archive]
thanks!
efrem
CAThreadgill
Member
Posted 1 year ago #
I need some help. On my website I have "Categories" and below that "Pages" and below that "Posts".
My problem is that I cannot get the "Posts" to sort alphabetically. I have tried the suggestion above and it didn't work for me. Maybe I was adding it in the wrong area.
Here is one of the pages:
http://wineloverstravelguide.com/category/arizona/
The theme I am using is "Twenty Ten"
Thanks