contacts

Get All 146 Premium WordPress Themes for Just $59.99
One-Time Payment: Unlimited Use Across Unlimited Domains, Plus Free Lifetime Updates! Learn more

WooCommerce Shop Homepage and front-page.php loading

WooCommerce Shop Homepage and front-page.php loading

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; ?>