query – get products by custom date variable

Question

i have a product attribute called review_date, and i would like to order these products by that date. I haven’t seen a working solution yet.. what am I doing wrong here?

$args = array(
        'post_type'      => 'product',
        'posts_per_page' => 20,
        'orderby'   => 'meta_value_num',
        'meta_key'  => 'pa_review_date',
); 

0
Sander1020 4 months 2022-04-23T05:17:17-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse