Notifications
Clear all

Is it possible to query post orderby wpdiscuz rating?

2 Posts
2 Users
0 Reactions
1,972 Views
(@robinwang)
New Member
Joined: 6 years ago
Posts: 1
Topic starter  

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
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

Hi @robinwang,

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


   
ReplyQuote
Share:
Scroll to top