这非常容易处理meta_query
s:
$args = array(
//basics
\'post_type\' => \'prizes\', // from question
\'post_status\' => \'publish\', // you didn\'t have this, but it\'s good practice
\'posts_per_page\' => 3, // I don\'t know where you got \'showposts\', but that\'s WAY old
//order
\'orderby\' => \'rand\',
//meta query
\'meta_query\' => array(
array(
\'key\' => $my_meta[\'pointsvalue\'],
\'value\' => ( $calctotalnew - number_format( $cart->total, 2 ) ),
\'compare\' => \'<=\',
\'type\' => \'NUMERIC\'
)
)
);
$my_query = new WP_Query( $args );
此外,您的
$do_not_duplicate
完全没有感觉。这是设置,但从未调用,您可能想解决这个问题。
我为你填写了一些细节,它们可能不对。这个documentation on WP_Query
将帮助您纠正一切错误。