Can't seem to sort by custom field value AND then by date?
-
Okay, so I am using a custom field called ‘reviews’. Posts using this field will contain a number from 1 to 5. What I’m trying to do is order posts from the highest number down to the lowest number, which I can achieve using the following code:
query_posts('meta_key=reviews&meta_compare=<=&meta_value=5&orderby=meta_value&order=DESC');
Now this works great, but the problem is that I also want the ordered post to be chronological too, so if I have two posts with the custom field value 5 I want the most recent post to be higher in a list than the older one.
Is this even possible? Or is it something that can only be achieved with a plug in?
Many thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Can't seem to sort by custom field value AND then by date?’ is closed to new replies.