Is it possible to query post orderby wpdiscuz rating?  

  RSS

robinwang
(@robinwang)
New Member
Joined: 1 month ago
Posts: 1
22/05/2019 1:55 pm  

Hello,

I want to query post orderby the post meta of wpdiscuz rating, but not work. How should i do? I used the code below:

    $args = array(
'post_type' => 'product',
'showposts' => 10,
'meta_key' => 'wpdiscuz_rating_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'brand',
'terms' => none,

),
)
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post();

Quote
Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 2668
22/05/2019 2:30 pm  

Hi @robinwang,

I'm sorry, but the code will not work as wpDiscuz saves the postmeta vale using the serialized array. 


ReplyQuote
Share: