0

Ok so i'm creating a Wordpress theme and i'm at the point where i'm trying to get a list of the reviews but the default comments_template() HTML isn't how I need it.

I don't have a /comments.php file in my theme root but i'm trying to use this:

comments_template( 'single-product/reviews.php' ); 

I don't know why but it's showing the default code with the avatar images and that. I don't need this. Basically I just need their name and 5 stars (using font-awesome). I know I don't have much code to show as i'm getting stuck at the comments template. Even if I try comments_template( '' ); it displays the default wp template.

This comments function is is called from content-single-product.php if that is anything. It might be important to note i'm building this ontop of underscores, that might.

Would it be worth just coding the review section manually? I'm only listing the reviews and outputting the form right?

1 Answer 1

0

content-single-product.php sounds like a woocommerce template, which is located here wp-content/plugins/woocommerce/templates. You can override this template in your theme or child them by creating a file wp-content/themes/your-theme/woocommerce/content-single-product.php.

3
  • Yea it works fine but my problem is with displaying the comments/reviews. The default woocommerce themes have the comments system rooted in some tab system so it's difficult to look at other themes and see where i'm going wrong Jul 3, 2015 at 16:19
  • Mind I ask, what theme you are using? Also, just to make sure comments are enabled ( Navigate to settings -> Discussion, check "Allow people to post comments on new articles" ). You can also check on the edit product page (Product Data -> Advanced check "Enable reviews")
    – paxamus
    Jul 3, 2015 at 18:01
  • Yea comments and all that are enabled and it's my own theme i'm writing. I just can't use the comments_templage correctly. All i want to do is list the rating and name but not with the default wordpress list. Jul 6, 2015 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.