'Woocommerce products are displaying on singular.php
I have created a custom theme and downloaded woocommerce plugin, the shop page is working fine however when I view a product only the content appears.
The products exist and when I copy the single-product.php into the theme folder they display correctly, but I want it to use the plugin folder and use the single-product.php file currently it is using singular.php to display the product why is the theme not using the plugin folder for the products I used the twentytwenty theme and it works fine but on my custom theme this is happening any help would be much apricated.
Solution 1:[1]
Currently, there is no support for woo-commerce, please add the below code in the functions.php file.
function mytheme_add_woocommerce_support() {
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dotsquares |