admin管理员组文章数量:1287800
I am building a website from scratch on WordPress using WooCommerce. I'll be having products from numerous brands and to have an easier time organizing them, I've made each brand a category. Currently, when I go to mywebsite/product-category/brand_name it's using my page.php template. I would like it to use a different one, but I'm not sure what file I need to add. I tried page-product-category.php, page-product.php, page-category.php and nothing seems to work. I understand that "woocommerce/content-product.php" is what I need to edit in order t ochange what the woocommerce output looks like, but I also need to edit everything else, header, navigation, footer and so on. I tried a few more different pages too, such as "woocommerce/woocomerce.php", "category.php", but still no luck, it still uses my page.php template. Thank you in advance!
I am building a website from scratch on WordPress using WooCommerce. I'll be having products from numerous brands and to have an easier time organizing them, I've made each brand a category. Currently, when I go to mywebsite/product-category/brand_name it's using my page.php template. I would like it to use a different one, but I'm not sure what file I need to add. I tried page-product-category.php, page-product.php, page-category.php and nothing seems to work. I understand that "woocommerce/content-product.php" is what I need to edit in order t ochange what the woocommerce output looks like, but I also need to edit everything else, header, navigation, footer and so on. I tried a few more different pages too, such as "woocommerce/woocomerce.php", "category.php", but still no luck, it still uses my page.php template. Thank you in advance!
Share Improve this question asked Sep 5, 2018 at 15:47 stefanplcstefanplc 1131 gold badge1 silver badge3 bronze badges 1- Also, if anyone is able to help, what about the other pages such as /product/, /cart/ and /checkout/? Thank you! – stefanplc Commented Sep 5, 2018 at 15:57
1 Answer
Reset to default 4product-category
URL uses taxonomy-product-cat.php
which calls archive-product.php
you will need to override it by creating the same file with the same name in themefolder/woocommerce/archive-product.php
You can open any file in templates folder in the WooCommerce plugin and you will find a line in the very top comment describes how to override the file.
Don't forget to add add_theme_support( 'woocommerce' );
in the theme functions.php
If It's not there.
本文标签: categoriesCustom page for WooCommerce39s productcategory
版权声明:本文标题:categories - Custom page for WooCommerce's product-category 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741285739a2370258.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论