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.
-
3You have it in 'yourtheme'/woocommerce/single-product.php (notice the lack of capital letters)?– rudtekCommented Mar 22, 2018 at 21:44
-
5I add this line to my theme functions.php and now everything working fine. add_theme_support( 'woocommerce' );– wpddCommented Mar 23, 2018 at 13:07
-
1Thank you. Adding add_theme_support('woocommerce') to functions is what fixed this problem for me, too.– LBFCommented 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');– kloddantCommented 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' ); ?>– Sujan ShresthaCommented Sep 8, 2019 at 14:01
|
Show 1 more comment