I
I
Ivan Dobroslavin2020-09-29 21:31:34
WordPress
Ivan Dobroslavin, 2020-09-29 21:31:34

How to load another product card template in WordPress?

Code in functions.php

/**
 * Adding Theme features
 */

if ( class_exists('WooCommerce') ) {
  require_once( get_template_directory() . '/inc/theme-woo-modification.php');
}
require_once( get_template_directory() . '/inc/theme-demo-install.php');


Woocommerce, new product card will be in another WordPress category, its template is '/inc/theme-woo-modification-2.php

' the code is in functions.php

if ( class_exists('WooCommerce') && in_category (1028) ) {
    require_once( get_template_directory() . '/inc/theme-woo-modification-2.php');
        else {
        require_once( get_template_directory() . '/inc/theme-woo-modification.php');
    }
}


How, relying on the fact that the product card will be in another category (heading), how can I make sure that the goods from this heading are connected from the new template?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question