Skip to content
Advertisement

Woocommerce rating not showing in new custom theme

I am working on to new custom theme. I have installed woocommerce plugin. I have import product from xml files. I had tried to test rating functionality. Its working on wordpress default theme twentytwelve, twentysixteen. etc. But when I switched to my custom theme. comment section not showing rating.

Take a look on screenshot. Comment section has only textarea.

Here is my code of comments.php

JavaScript

my screenshot

Advertisement

Answer

You might need to declare WooCommerce support if you are using custom theme in order to make it compatible with WooCommerce. Default WordPress themes would be normally compatible with WooCommerce and they will work without adding anything. You can read more here – https://woocommerce.com/document/third-party-theme-compatibility/.

Step 1: Add this to your theme’s ‘functions.php’.

JavaScript

Step 2: If still reviews not showing, copy your theme’s ‘page.php’ as ‘woocommerce.php’. Remove the loop – <?php if(have_posts()): while(have_posts()): the_post(); ?> and <?php endwhile; endif; ?>. Replace the_content() with woocommerce_content().

Let me know whether these fixes the issue, else paste new ‘woocommerce.php’ contents in your question.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement