How do I sort the posts upon click of links?
Sort by: Latest | Most Popular | Score
Most popular is by view count and is by custom field in DESC order.
How do I sort the posts upon click of links?
Sort by: Latest | Most Popular | Score
Most popular is by view count and is by custom field in DESC order.
There are ways to display latest and most popular posts with widgets, but I don't know about "Score".
There are also plug-ins that will do this, though I haven't any personal experience using them. I'd start with this search:
http://wordpress.org/extend/plugins/search.php?q=sort+posts&sort=
I've exhausted the plugins list.
The closest I've come to it WP Smart Sort, but it is very difficult to style the menu.
Could you not have three templates to do this? That only differ by the query_post parameters used. And whether Latest, Most Popular or Score is highlighted after the "Sort by:". I'm assuming that default sort if Latest.
Those three links (Latest, Most Popular, Score) would point to three otherwise identical pages, that only differ in what Page Template they are assigned to.
Thinking about it more, I realized you could avoid the three templates by passing a parameter through the "Sort by:" URL you specify, e.g. - &sortby=latest
How do I sort the posts upon click of links?
By using a conditionalised query variable that's passed into the query to determine which order they display in.
This topic has been closed to new replies.