Hi, I'm using Post Ratings on one of my Wordpress sites and I want to give my visitors the possibility to sort the posts by rating. For that I'm using a $_GET function and this code:
Wordpress orderby function
2
Hi,
I'm using Post Ratings on one of my Wordpress sites and I want to give my visitors the possibility to sort the posts by rating. For that I'm using a $_GET function and this code:
("rating" is a custom field)
The code works fine but I also want to sort the posts by number of votes so that a post that has a rating of 5 and 3 votes should be placed before a post that has a rating of 5 but only 1 vote. How can I do that?
/Woolwich
I'm using Post Ratings on one of my Wordpress sites and I want to give my visitors the possibility to sort the posts by rating. For that I'm using a $_GET function and this code:
PHP Code:
case 'rated' : $orderby = '&meta_key=rating&orderby=meta_value';
The code works fine but I also want to sort the posts by number of votes so that a post that has a rating of 5 and 3 votes should be placed before a post that has a rating of 5 but only 1 vote. How can I do that?
/Woolwich
- SteveJohnson
Next Topics on Trending Feed
-
2