What PHP file does WooCommerce Shop Page use?
As you know, WooCommerce creates a bunch of its system pages after installation, like “Cart”, “Checkout”, “My Account” etc.
For pages like “Cart” and “Checkout” everything is quite obvious, but “Shop” page seems like an archive page, isn’t it? As for me, for the first time I thought that the file for this page should be
archive.php or something like that… what can I say, I was surprised.
Look at the diagram below:
page-$slug.php– the most priority file, by the way it allows you to set a custom page template for your Shop page, just specify the page slug in the file name, like
page-shop.phpor something like that.
page-$slug.phpdoesn’t exist, WooCommerce will look for this file
index.php– if none of the above files exist in your theme,
index.phpwill be used
As you can see, I cut out
custom.php (Custom Page Templates) from the image – it is because WooCommerce removes the dropdown option where you can choose a custom page template for the Shop page.
One more thing – if your Shop page is displayed as website homepage, the most priority file will be
front-page.php, everything else as on the diagram above.