TransWikia.com

Custom page for WooCommerce's /product-category/

WordPress Development Asked by stefanplc on December 12, 2021

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.com/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!

One Answer

product-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.

Answered by Ash0ur on December 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP