Exclude custom postmeta
-
Hello. I have a site that has articles rated from G, PG, R, X, etc. These carry a numeric wp_postmeta value of 1, 2, 3, or 4. How can I exclude posts whose “post_rating” > 2 from the search results?
Do I add something like array(‘meta_key’ => ‘post_rating’,’meta_value_num’ => 3,’meta_compare’ => ‘<‘) to the query as a function? Or what would you suggest is the best way to filter out posts with a meta_key of post_rating and a meta_value greater than 2?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Exclude custom postmeta’ is closed to new replies.