Buy All 48 Premium WordPress Themes for $54.99

WooCommerce Shop Homepage and front-page.php loading

woocommerce shop home page

The themefolder/front-page.php is loaded by WordPress to render site’s front pages (a Static Front Page or Blog Posts Index depending configuration set on Admin Panel -> Left Menu -> Settings -> Reading).

There is one exception from the above rule:

When WooCommerce Shop Page (Admin Panel -> Left Menu -> WooCommerce -> Settings -> ‘Products’ Tab -> Shop page) is set as a Static Front Page then the WooCommerce plugin will suppress the front-page.php loading and will load default template for product listing page.

So, if there are for example Homepage widgets areas defined in front-page.php they won’t be displayed in site when there is WooCommerce Shop homepage.

The above can be resolved by adding code in themefolder/header-shop.php and/or themefolder/footer-shop.php files, i.e.

<?php if ( is_front_page()
           && get_option( 'show_on_front' ) == 'page' ) :

         dynamic_sidebar( 'homepage-widget-area' );

       endif; ?>

About the Author

Tihomir Ivanov is a WordPress and Salesforce Commerce Cloud (SFCC) developer, founder of tishonator.com, a fan of Linux and Open Source, Minimalism (in Design and Life), Sci-fi, Fantasy, Classic and History books :)

Leave a Reply