Title: display in WP_Query loop
Last modified: March 13, 2019

---

# display in WP_Query loop

 *  [justinblayney](https://wordpress.org/support/users/justinblayney/)
 * (@justinblayney)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/display-in-wp_query-loop/)
 * Hello,
 * I have WP_Query for a custom post type, I would like to display the rating in
   this list of custom post types, I imagine I need to send the custom post type
   ID to the function, but that is just my guess. How do i make the below work?
 * <?php
 *  $the_query = new WP_Query( array(‘posts_per_page’=>20,
    ‘post_type’ =>’services’,‘
   post_status’ => ‘publish’ ); ?> <?php while ($the_query -> have_posts()) : $the_query-
   > the_post(); ?> <h2><?php echo get_the_title(); ?></h2> <?php Custom_Ratings::
   get_rating_object_image_src(); echo Custom_Ratings_Public::display(); echo Custom_Ratings_Public::
   vote();
 * endwhile;
    ?>
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdisplay-in-wp_query-loop%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘display in WP_Query loop’ is closed to new replies.

 * ![](https://ps.w.org/custom-ratings/assets/icon-256x256.jpg?rev=1369537)
 * [Custom Ratings](https://wordpress.org/plugins/custom-ratings/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-ratings/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-ratings/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-ratings/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-ratings/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-ratings/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * 0 replies
 * 1 participant
 * Last reply from: [justinblayney](https://wordpress.org/support/users/justinblayney/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/display-in-wp_query-loop/)
 * Status: not resolved