• Resolved darlinncordova

    (@darlinncordova)


    hi i did this code and works fine but i cant get all “juegos posts” just posts with rating , how can i get rating and no rating list posts.

    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $args = array(
    	'post_type' => 'juegos',
    	'post_parent' => 0,
    	'meta_key' => 'ratings_average',
    	'orderby'=>'meta_value_num',
    	'order'=>'DESC',
    	'paged'=> $paged,
    	'posts_per_page' => 5
    );
    $the_query = new WP_Query( $args );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    https://wordpress.org/plugins/wp-postratings/

Viewing 1 replies (of 1 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Sorry, you can’t get posts without ratings, there is a limitation with the WP_Query and custom post field.

    The only manual way I can think of is manually create the custom post field “ratings_average” for post that have no ratings.

    The reason why it does not have those fields I am guessing is because it was created before WP-PostRatings was activated. Once WP-PostRatings is activated, upon every post, it will create the custom post field with 0 as the value.

Viewing 1 replies (of 1 total)
  • The topic ‘Sort custom post type by rating score’ is closed to new replies.