Buy All 121 Premium WordPress Themes for $59.99
No Additional Fees, Pay Once and Use Unlimited Time for Unlimited Domains, Free Lifetime Updates

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

Leave a Reply