I have custom meta field
that I use for the post rating
.
So I want to display posts by the date
and the rating
, but only for the posts that have specific rating.
For example, I want to display posts with rating above 3, and in this order: by the rating (highest first), but grouped by the date (today’s best rated, then yesterday’s best rated, etc.).
Can I do it with WP_Query($args=array())
class?
Basically, I am reading right out of the Codex page for
WP_Query
.You want a
meta_query
similar to this with anorderby
parameter with the two values you want to order by. The first is dominant.I don’t know what your
rating
field is named and I don’t have your posts and your ratings on my system so I can’t test that. Hopefully that will get you started.