help with adding review counts next to review star ratings
-
Hi all, Currently building a site using the Qoa block theme and wanted to add a review count next to the review stars block in the products archive pages which I've managed to do using the following php code: function custom_display_product_reviews() { global $product; if ( $product && $product->get_id() ) { $reviews_count = $product->get_review_count(); if ( $reviews_count > 0 ) { echo '<div class="custom-reviews-count">'; echo '<span class="review-count">(' . $reviews_count . ') </span>'; echo '</div>'; } } } add_action( 'woocommerce_before_shop_loop_item_title', 'custom_display_product_reviews', 5 ); This was taken from this instruction video here and slightly altered so that the review count only shows a number inside the brackets,. This got the review count to appear under the review stars, and I then used the "yellow pencil" plug in to move the review count next to the stars: https://www.youtube.com/watch?v=uS_4HSZECRs This is working well and has been the only method I found that worked on my site. I now have the product review count on my shop page and category pages. However, I also have a "sale" page which has products using the products (beta) block (with the option to only show on sale products) and the review count isn't showing on this page. Is there a way I can get the review count to show on my "sale" page as well? The review counts are also not working on my home page either. Thanks.
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘help with adding review counts next to review star ratings’ is closed to new replies.