WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
Return 4 or 5 star post at random? (1 post)

  1. danlawson
    Member
    Posted 1 year ago #

    Hi all,

    I have looked through this support forum but was unable to find what im looking for so apologies if ive missed the answer.

    I am developing a query_posts arguments list to return a random custom post type with a rating of 4 or above.

    My current code looks like:

    $query_args['post_type'] = 'recipes';
    $query_args['post_status'] = 'publish';
    $query_args['r_sortby'] = 'highest_rated';
    $query_args['r_orderby'] = 'rand';
    $query_args['posts_per_page'] = '1';
    query_posts($query_args);

    This is returning the highest rated recipe. How can I amend to only return a random 4/5 star recipe?

    Thanks very much.

    http://wordpress.org/extend/plugins/wp-postratings/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic