Sort the posts alphabetically.

Latest Reply from emdomain at 2012-06-15 07:28:17

Hi.

I use Forrealty theme.
How can I sort posts alphabetically in tag-pages and category-pages?

Thank you for help.

emdomain

Hi!
You can order posts alphabetically by adding parameters 'orderby=title&order=ASC' in function query_posts() on the 2nd line in file theloop.php

query_posts($query_string."&orderby=title&order=ASC");

if you want this order only in tag-pages and category-pages you have to add following conditional statement

if (is_tag()||is_category())
query_posts($query_string."&orderby=title&order=ASC");
else
query_posts($query_string);

Hi.

Thank you for the really quick response.
Everything works properly, of course.

emdomain

Leave a reply

Add codeAdd image