Offer alphabetical & date search for same category
-
I have a page showing the latest post from Category X. It has a navigation option near the top like this:
CURRENT | ALPHABETICAL | BY DATE
Current is grayed out and the other two are active. The idea is that the user can choose to see the archives for Category X either blog-style or index-style. (Each is actually styled quite differently.)
I know how to create a custom category page for the category. I know how to get the loop to display either alphabetically or by date. What I can’t work out is how to get the two links to:
a) point to two different category pages that use different ways of sorting Category X; or
b) write a conditional if statement in a custom category page that “knows” which link has called it up, and sorts accordingly.Well I can work it out, but the way I am thinking of seems like overkill. I could write a function that causes the link to store a boolean in the database, and another function that causes the category page to switch sorting methods according to the value it finds in the database.
This seems like overkill to me, as well as being inefficient. Is there a better way to do this?
Any suggestions gratefully accepted ??
Cheers
Owen
- The topic ‘Offer alphabetical & date search for same category’ is closed to new replies.