Reverse Ordering Category Archive listing?
-
I am using the generic category archive listing. It has the “if_posts()”, and then the “while have_posts()”.
But this results in a chronologically descending listing of all entries in that category based on post_id. I would like them to be sorted by modified_date.
So I tried playing around with doing a “query_posts()” call. Like this:
query_posts('cat=53&orderby=modified&order=desc');This works, but I would like NOT to hardcode my category number like this because that would mean many category-xx.php files.
Instead, I would like to just get the *current* category and get all posts from that category but ordered by modified_date.
How can this be done? I have tried some variations with get_object, etc, but none of them work.
In summary, my question:
In a category archive page, what code should I use to get hold of the current category?
The topic ‘Reverse Ordering Category Archive listing?’ is closed to new replies.