I'm trying to add :
require get_template_directory() . '/mytheme/folder/file.php';
To specific category in WooCommerce, I tried already:
function get_file() {
if( has_term( 'categoryName', 'product_cat' ) ) {
require get_template_directory() . '/mytheme/folder/file.php';
}
}
add_action( 'woocommerce_before_main_content', 'get_file');
But it doesen't work ;/ How can i add this file only for 1 category? Or for multi cat. by using else if Regards, Gabrielle
See Question&Answers more detail:os