F
F
freeman02042017-10-11 22:41:49
PHP
freeman0204, 2017-10-11 22:41:49

Do I have the correct structure for my Woocommerce theme?

prntscr.com/gw7sad is such a minimal theme for now. As I understand it, I am overriding files from /wp-content/plugins/woocommerce/templates. Theme doesn't work without index.php in the Woocommerce folder archive-product.php is the main index.php file. In fact, if I now write in archive-product.php, then this should be displayed on the page, but it is not reflected. And if I write on index.php but everything is visible. How to fix it? I will say right away that there will be no goods on the site on the main page. There are categories with products and by clicking there is already a transition to the catalog and from there to single.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zorca, 2017-10-11
@zorca

Install the Query Monitor plugin, it will help solve many problems. You will see which templates are requested by Wordpress and which ones are found and used, plus many more features that will be needed in the future. If you want an answer - give the contents of your files in the template, specifically archive-product.php, why did you decide that it is not used?

I
Igor Vorotnev, 2017-10-12
@HeadOnFire

You haven't quite grasped the WP template hierarchy. The index.php file is needed not only because "theme does not work without index.php", but because it is the main fallback template that is used if a more suitable (more specific) one is not found.
In your current configuration, absolutely all site pages will use index.php, except for product archives. The WooCommerce archive-product.php template is used to display product pages (all products, products in a category, etc.) including the main page of a store (not a website!) which is usually example.ru/shop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question