5

single-product.php template not working for my Woo commerce single products and instead it is using single.php file of my theme. I do not have woocommerce.php file in my theme but still single-product.php not executing. Any idea about this will be much appreciated.

6
  • 3
    You have it in 'yourtheme'/woocommerce/single-product.php (notice the lack of capital letters)?
    – rudtek
    Commented Mar 22, 2018 at 21:44
  • 5
    I add this line to my theme functions.php and now everything working fine. add_theme_support( 'woocommerce' );
    – wpdd
    Commented Mar 23, 2018 at 13:07
  • 1
    Thank you. Adding add_theme_support('woocommerce') to functions is what fixed this problem for me, too.
    – LBF
    Commented Jun 19, 2018 at 15:02
  • Note that, when you add add_theme_support( 'woocommerce' );, it must be outside of any function call. Aka, you cannot put it in the add_support function and call that function from add_action('init', 'add_support');
    – kloddant
    Commented Jun 19, 2018 at 22:33
  • Best answer will be create singe-product.php file in your theme folder. And write this code <?php wc_get_template_part( 'content', 'single-product' ); ?> Commented Sep 8, 2019 at 14:01

0

Browse other questions tagged or ask your own question.