taxonomy . '.php'; $find[] = 'taxonomy-' . $term->taxonomy . '-' . $term->slug . '.php'; $find[] = WOOCOMMERCE_TEMPLATE_PATH . 'taxonomy-' . $term->taxonomy . '-' . $term->slug . '.php'; $find[] = $file; $find[] = WOOCOMMERCE_TEMPLATE_PATH . $file; } elseif ( is_post_type_archive( 'product' ) || is_page( woocommerce_get_page_id( 'shop' ) ) ) { $file = 'archive-product.php'; $find[] = $file; $find[] = WOOCOMMERCE_TEMPLATE_PATH . $file; } if ( $file ) { $template = locate_template( $find ); if ( ! $template ) $template = WC()->plugin_path() . '/templates/' . $file; } return $template; } /** * comments_template_loader function. * * @param mixed $template * @return string */ public function comments_template_loader( $template ) { if ( get_post_type() !== 'product' ) return $template; if ( file_exists( STYLESHEETPATH . '/' . WOOCOMMERCE_TEMPLATE_PATH . 'single-product-reviews.php' )) return STYLESHEETPATH . '/' . WOOCOMMERCE_TEMPLATE_PATH . 'single-product-reviews.php'; elseif ( file_exists( TEMPLATEPATH . '/' . WOOCOMMERCE_TEMPLATE_PATH . 'single-product-reviews.php' )) return TEMPLATEPATH . '/' . WOOCOMMERCE_TEMPLATE_PATH . 'single-product-reviews.php'; elseif ( file_exists( STYLESHEETPATH . '/' . 'single-product-reviews.php' )) return STYLESHEETPATH . '/' . 'single-product-reviews.php'; elseif ( file_exists( TEMPLATEPATH . '/' . 'single-product-reviews.php' )) return TEMPLATEPATH . '/' . 'single-product-reviews.php'; else return WC()->plugin_path() . '/templates/single-product-reviews.php'; } } new WC_Template_Loader();