Load a custom template for single products
-
Any idea why the following would have stopped working with the most recent Woo updates? We use a custom template for products within a certain category. This was working fine as recently as Jan. 17.
add_filter( ‘template_include’, ‘so_25789472_template_include’ );
function so_25789472_template_include( $template ) {
if ( is_singular(‘product’) && (has_term( 8, ‘product_cat’)) ) {
$template = get_stylesheet_directory() . ‘/woocommerce/single-product-issue.php’;
}
return $template;
}
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Load a custom template for single products’ is closed to new replies.