Skip to content

Instantly share code, notes, and snippets.

@chrisvanpatten
Created May 19, 2014 12:48
Show Gist options
  • Select an option

  • Save chrisvanpatten/277a3bd2f4e51070d92f to your computer and use it in GitHub Desktop.

Select an option

Save chrisvanpatten/277a3bd2f4e51070d92f to your computer and use it in GitHub Desktop.
<?php
/**
* vpm_comments_template
*
* Load our own template file for WooCommerce reviews
*/
function vpm_comments_template( $template ) {
global $woocommerce;
$comments_template_path = get_stylesheet_directory() . '/woocommerce/single-product-reviews.php';
if ( get_post_type() == 'product' && file_exists( $comments_template_path ) ) {
return $comments_template_path;
}
if ( get_post_type() == 'product' ) {
return $woocommerce->comments_template_loader( $template );
}
}
add_filter( 'comments_template', 'vpm_comments_template', 100, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment