Is there any way of changing the post order, posts number, etc via user click?
The same way you can choose displaying questions by time and vote here at StackExchange.
How to accomplish that?
Is there any way of changing the post order, posts number, etc via user click?
The same way you can choose displaying questions by time and vote here at StackExchange.
How to accomplish that?
You must be logged in to post a comment.
Check the WP Sort Plugin, it does exactly what you need:
http://wordpress.org/extend/plugins/wp-post-sorting/
By using the $_GET function at the top
<?php $sort= $_GET['sort'];
if($sort == "title")
{
$order= "orderby=title";
}
if($sort == "date")
{
$order= "orderby=date";
}
?>
You can use links like that:
Or a dropdown list:
Then Comes the loop
Just my example based on Boldhand a way to change the title of a Custom Post Type ASC and DESC:
Yes, it is possible. You’ll want to look at the Order & Orderby Parameters to WP_Query and since you didn’t give too many details here, you should probably also look at When should you use WP_Query vs query_posts() vs get_posts()? as well.
You can always add
orderby
to your URLs to specify a field to order the posts. Earlier today I gave an answer on how to do this with “nice” URLs.So you (“only”) need to generate the links on each archive page. This should be rather easy, but I think you can find plugins for that too.