• Resolved Daniel

    (@dmzayasplus)


    I was looking for an answer to this in the threads but couldn’t find a good answer.

    I have a custom post type and only that type has ratings. I went into the theme and the place that queries the list of posts and tried the following code:

    <?php
        $args = array(
            'post_type' => 'reviewer',
            'posts_per_page' => -1,
             array(
                 'meta_key' => 'ratings_average',
                 'orderby' => 'meta_value_num',
                 'order' => 'DESC'
             )
        );
        $loop = new WP_Query( $args );
        while ( $loop->have_posts() ) : $loop->the_post();
    ?>

    That code does not work. Anyone have any workarounds?

    https://www.ads-software.com/plugins/wp-postratings/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Post Type Query’ is closed to new replies.