• Hi, Im using this code:

    $q_ratings     = new WP_Query( array(
    'post_type' => BID,
    'post_parent' => get_the_ID(),
    'post_status' => array('publish','complete', 'accept'),
    'posts_per_page'=>-1,
    'meta_key'   => 'mr_rating_results',
    'ignore_sticky_posts' => true,
    'orderby'    => 'meta_value_num',
    'order'      => 'DESC'
    ));

    with the metakey ‘mr_rating_results’

    but it’s showing all the post even the post with no ratings.

    I Would like to ask on how to show only the post which are rated, highest on top, lowest on bottom.

    I read all the support forum questions, but nothing shows same problem like mine.

    Thankyou Daniel.

    https://ww.wp.xz.cn/plugins/multi-rating/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author dpowney

    (@dpowney)

    Hi there,

    In the free version, this meta key is actually an array. So you cannot use it in a query.

    The Pro version however stores ratings in a separate database table. You can use the following code snippet to modify the WP Query.

    https://gist.github.com/danielpowney/716b65779dd402743c59#file-sort_wp_query-php

    Note that in v5 of the plugin which will be available soon there will be a setting to sort the main WP loop by highest ratings.

    The free version will be updated sometime in the future to store ratings in the same way as the Pro version but I don’t have any timeframes on it at the moment.

    Daniel

    Thread Starter pryde1919

    (@pryde1919)

    Hi, I’m considering to purchase the pro version. and if I purchase the pro version, is there a metakey or anything that can rank from highest to lowest?

    will you help me on this after i purchase the pro version?

    This is SO BAD.

    Isn´t it VERY common and useful to sort search results by rating?

    Why can´t we just have a post field with the average post rating?
    (I´m using toolset views.)

    Right now I´m close to regretting having purchased your plugin and spent so much time inplementing it, although besides that I really LOVE it… 🙁

    Kind regards

    Plugin Author dpowney

    (@dpowney)

    Hi,

    I see your point and understand this is needed. There’s been some progress in last 3 months.

    Please see FAQ11 here which explains how the Pro version now stores a copy of ratings in a couple of post meta fields since v5.0.2. e.g. mrp_rating_result_1_star_rating is a post meta field which contains the average star rating for rating form 1.

    I’ll make updating the free version to store an average star rating value in a post meta field a priority.

    Daniel

    Hi,

    Thanks for your answer, sounds promising to me. When will v 5 be available?

    I only have v 4.1.8, and it won’t update.

    Kind regards

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘How to show the rated post in new WP_Query’ is closed to new replies.