Pulling reviews using WP_Query
-
I am using a WP_Query to display a list of products using a CPT. I am trying to figure out how to pull in the review stars only for each product.
My code looks like this for the product list<?php
$args = array(
'posts_per_page' => 4,
'post_type' => 'products',
'orderby' => 'menu_order',
'order' => 'ASC'
);
$the_query = new WP_Query( $args );
while ($the_query -> have_posts()) : $the_query -> the_post();
?>
<div class="product-list-container <?php echo implode(' ,', wp_get_post_tags( get_the_ID(), array('fields' => 'names') ) ); ?>">
<a href="<?php the_permalink() ?>">
<div class="img-place"><img src="<?php echo get_the_post_thumbnail_url( get_the_ID(), 'full' ); ?>" alt="<?php the_title(); ?>" /></div>
<span><?php the_title(); ?></span>
* Display review stars here *
</a>
</div>
<?php endwhile;
wp_reset_postdata();
?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.