wpDiscuz 7 Beta Version is Released!

 

Today, on 01.20.2020 we’re excited to release wpDiscuz 7 Beta 1 into the wild!
The version 7 has been in development since December 2018. About one year of hard work is ready to be tested. It’s hard to believe it’s been so long since our last major v5 release, but sometimes good things are worth waiting for.

Try wpDiscuz 7 Beta 1

Is it possible to query post orderby wpdiscuz rating?  

  RSS

robinwang
(@robinwang)
New Member
Joined: 8 months 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: 3513
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:
Green
Default
Pear
Black Emo
{green}:grinning:
{green}:wink:
{green}:face:
{green}:inlove:
{green}:sweaty:
{green}:surprised:
{green}:lovekiss:
{green}:laugh:
{green}:formalsmile:
{green}:displeased:
{green}:cool:
{green}:resent:
{green}:nerd:
{green}:screaming:
{green}:amazed:
{green}:sad:
{green}:deceitful:
{green}:starryeyes:
{green}:evil:
{green}:shocked:
{green}:tears:
{green}:sulky:
{green}:smile:
{green}:vomited:
{green}:hi:
{green}:afraid:
{green}:crazy:
{green}:rabid:
{green}:fighting:
{green}:nonoise:
{green}:blushed:
{green}:idontknow:
{green}:scared:
{green}:razz:
{green}:kiss:
{green}:eat:
{green}:shutmouth:
{green}:gape:
{green}:suspicious:
{green}:laughingoutloud:
{green}:bruise:
{green}:crying:
{green}:pray:
{green}:serious:
{green}:excitement:
:)
:d
:wink:
:mrgreen:
:neutral:
:twisted:
:arrow:
:shock:
:???:
:cool:
:evil:
:oops:
:razz:
:roll:
:cry:
:eek:
:lol:
:mad:
:sad:
:!:
:?:
:idea:
:hmm:
:beg:
:whew:
:chuckle:
:silly:
:envy:
:shutmouth:
{pear}:happy:
{pear}:smile:
{pear}:laugh:
{pear}:laughingoutloud:
{pear}:crying:
{pear}:exhausted:
{pear}:nerd:
{pear}:surprised:
{pear}:veryhungry:
{pear}:wink:
{blackemo}:laughtertotears:
{blackemo}:gift:
{blackemo}:love:
{blackemo}:inlove:
{blackemo}:shamefaced:
{blackemo}:heart:
{blackemo}:crazy:
{blackemo}:anguished:
{blackemo}:bruise:
{blackemo}:easymoney:
{blackemo}:exhausted:
{blackemo}:vampire:
{blackemo}:shutmouth:
{blackemo}:wink:
{blackemo}:carnival:
{blackemo}:flowers:
{blackemo}:hotdrink:
{blackemo}:party: