Storefront is a free theme (with 100,000+ active install), developed & designed by WooCommerce Core Developers. I’ve put together a list of snippets so that you can quickly and easily customize your Storefront Homepage.
Storefront Homepage
The Storefront theme’s Homepage has 6 sections:
- Page Content
- Product Categories section
- Featured Products section
- Recent Products section
- Top Rated Products section
- On Sale Products section
- Best Selling Products section
How To Setup Storefront Homepage
To display Homepage sections on your homepage, you have to assign the Homepage template to your page.
Follow these steps to display storefront sections on your homepage:
- Go to Dashboard -> Pages and create a page title homepage
- On the right hand side, you will find a box titled “Page Attributes“
- Select “Homepage” from “Template” drop-down.
- Click on Update to save the change.
Add / Re-order / Remove Homepage Sections
How To Re-order Storefront Homepage Sections
You can easily re-order your Storefront homepage sections using WooThemes Homepage Control plugin. Follow below steps to re-order your homepage sections:
- Download & Install Homepage Control
- Go to Appearance -> Customize -> Homepage Control
- Drag & re-order the sections according to your need.
- Click on Save & Publish to save the changes.
How To Remove Sections from Storefront Homepage
You can remove or hide the any sections (e.g.: Product category, Recent, Best-selling) from your homepage using Homepage Control plugin.
Follow these steps to remove homepage sections:
- Download & Install Homepage Control
- Go to Appearance -> Customize -> Homepage Control
- Un-check the box beside the sections you do want to display.
- Click on Save & Publish.
How To Add A Full Width Slider To Storefront Homepage
You can add any slider to your storefront homepage using Storefront Add Slider plugin. Follow these steps:
- Download & install Storefront Add Slider
- Go to Appearance -> Customize -> Static Front Page
- Paste your slider shortcode in Slider Shortcode field
- Click on Save & Publish
Set Background Color / Image
Adding Background Image To Storefront Homepage Sections
By default, Storefront homepage has 6 sections. You can display product categories, Recent products, Featured products, popular products, On Sale products and Best Selling products.
If we want to add a background image to those sections, we have to identify the class of each sections. Here is the class of each sections.
.storefront-product-categories{}
.storefront-recent-products{}
.storefront-featured-products{}
.storefront-popular-products{}
.storefront-on-sale-products{}
.storefront-best-selling-products{}
Now let’s set a background image to Storefront Homepage featured products section. Insert the below css in Appearance -> Customize -> Additional CSS
.storefront-featured-products{
background-image: url(https://www.storefront.www.businessbloomer.com/wp-content/uploads/2017/08/Featured-pattern.png);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
-o-background-size: cover;
}
Adding Background Color To Storefront Homepage Sections
.storefront-featured-products {
background-color:#FFEB3B;
}
Customize Storefront Homepage Section Title
How to Remove or hide the Homepage Section Title
If you want to get rid of the section title (Shop by Category,” “New In,” or “Best Sellers”) from your homepage, insert this in Additional CSS
.storefront-recent-products .section-title {
display:none;
}
How To Change the Homepage Section Title
If you want to change the section title (Shop by Category,” “New In,” or “Best Sellers”) to something else, you have to do this via hooks.
Here is a list of all storefront homepage section filters:
storefront_product_categories_args
storefront_recent_products_args
storefront_featured_products_args
storefront_popular_products_args
storefront_on_sale_products_args
storefront_best_selling_products_args
Insert this in your themes functions.php to change the featured product section title:
add_filter( 'storefront_featured_products_args', 'bbloomer_storefront_product_featured_title');
function bbloomer_storefront_product_featured_title( $args ) {
$args['title'] = 'New Featured Products Title Here';
return $args;
}
Customize Number of Products / Column
How To Increase Homepage Section Product Per Page
add_filter( 'storefront_featured_products_shortcode_args', 'bbloomer_storefront_featured_product_per_page' );
function bbloomer_storefront_featured_product_per_page( $args ) {
$args['per_page'] = 10;
return $args;
}
How To Increase Homepage Section Product Column Grid / Column
add_filter( 'storefront_featured_products_shortcode_args', 'bbloomer_storefront_featured_product_per_row' );
function bbloomer_storefront_featured_product_per_row( $args ) {
$args['columns'] = 2;
return $args;
}
Customizing Storefront Product categories
How To Display More Categories on Homepage
add_filter( 'storefront_product_categories_shortcode_args', 'bbloomer_storefront_category_per_page' );
function bbloomer_storefront_category_per_page( $args ) {
$args['number'] = 10;
return $args;
}
Other Customizations
How To Add a Description Below Homepage Section Title
add_action( 'storefront_homepage_after_featured_products_title', 'bbloomer_storefront_product_featured_description');
function bbloomer_storefront_product_featured_description(){
echo '<p>Section description here</p>';
}
Top Rated Products
How To Remove Top Rated Products Section from Storefront Homepage
There are two ways you can remove the Top Rated Products section from your Homepage template. One is installing Homepage Control plugin and the other is removing using the hooks. Lets see how we can remove the Top Rated Products section using Hooks. Place this in your themes functions.php
remove_action( 'homepage', 'storefront_popular_products', 50 );
How To Change Background Color of Top Rated Products
If you want to change the background color of Top Rated or Popular Products section, then insert this in Appearance > Customize > Additional CSS.
.storefront-popular-products {
background-color:#FFEB3B;
}
How To Remove Top Rated Products Section Title
Insert this in Appearance > Customize > Additional CSS to remove or hide the On Sale Products section title.
.storefront-popular-products .section-title {
display:none;
}
How To Change Top Rated Products Section Title
If you want to change the section title from “On Sale” to anything else, just insert this snippet at the bottom of your child theme functions.php
add_filter( 'storefront_popular_products_args', 'bbloomer_storefront_product_popular_title');
function bbloomer_storefront_product_popular_title( $args ) {
$args['title'] = __( 'Top Products', 'storefront' );
return $args;
}
How To Display More Products on Top Rated Section
By default Storefront Top Rated Products section displays 4 products. Lets increase it to 12 products.
add_filter( 'storefront_popular_products_shortcode_args', 'bbloomer_storefront_top_product_per_page' );
function bbloomer_storefront_top_product_per_page( $args ) {
$args['per_page'] = 12;
return $args;
}
How To Add a Text Below Top Rated Products Section
This code snippet will let you add text or HTML depending on your need below the Top Rated Products section title. Just place PHP this snippet at the bottom of your child theme functions.php file before “?>”
add_action( 'storefront_homepage_after_popular_products_title', 'bbloomer_storefront_top_product_description');
function bbloomer_storefront_top_product_description(){ ?>
echo "Section description here";
}
On Sale Products
How To Remove On Sale Products Section from Storefront Homepage
There are two ways you can remove the On Sale Products section from your Homepage template. One is installing Homepage Control plugin and the other is removing using the hooks. Lets see how we can remove the On Sale Products section using Hooks. Place this in your themes functions.php
remove_action( 'homepage', 'storefront_on_sale_products', 60 );
How To Change Background Color of On Sale Products
If you want to change the background color of On Sale Products section, then insert this in Appearance > Customize > Additional CSS.
.storefront-on-sale-products {
background-color:#FFEB3B;
}
How To Remove On Sale Products Section Title
Insert this in Appearance > Customize > Additional CSS to remove or hide the On Sale Products section title.
.storefront-on-sale-products .section-title {
display:none;
}
How To Change On Sale Products Section Title
If you want to change the section title from “On Sale” to anything else, just insert this snippet at the bottom of your child theme functions.php
add_filter( 'storefront_on_sale_products_args', 'bbloomer_storefront_product_sale_title');
function bbloomer_storefront_product_sale_title( $args ) {
$args['title'] = __( 'Huge Discount', 'storefront' );
return $args;
}
How To Display More Products on On Sale Section
By default Storefront On Sale Products section displays 4 products. Lets increase it to 12 products.
add_filter( 'storefront_on_sale_products_shortcode_args', 'bbloomer_storefront_sale_product_per_page' );
function bbloomer_storefront_sale_product_per_page( $args ) {
$args['per_page'] = 12;
return $args;
}
How To Add a Text Below On Sale Products Section
This code snippet will let you add text or HTML depending on your need below the On Sale Products section title. Just place PHP this snippet at the bottom of your child theme functions.php file before “?>”
add_action( 'storefront_homepage_after_on_sale_products_title', 'bbloomer_storefront_sale_product_description');
function bbloomer_storefront_sale_product_description(){ ?>
echo "Section description here";
}
Best Selling Products
Best Selling Products sections displays most sold products of your store. Simply put, it sort all the products by total sales and display them in a descending order.
How To Remove Best Selling Products from Storefront Homepage
There are two ways you can remove the Best Selling section from your Homepage template. One is installing Homepage Control plugin and the other is removing using the hooks. Lets see how we can remove the Best Selling Products section using Hooks. Place this in your themes functions.php
remove_action( 'homepage', 'storefront_best_selling_products', 70 );
How To Change Background Color of Best Selling Products
If you want to change the background color of Best Selling Product section, then insert this in Appearance > Customize > Additional CSS.
.storefront-best-selling-products {
background-color:#FFEB3B;
}
How To Remove Best Selling Products Section Title
Insert this in Appearance > Customize > Additional CSS to remove or hide the Best Selling Product section title.
.storefront-best-selling-products .section-title {
display:none;
}
How To Change Best Selling Products Section Title
If you want to change the section title from “Best Sellers” to anything else, just insert this snippet at the bottom of your child theme functions.php
add_filter( 'storefront_best_selling_products_args', 'bbloomer_storefront_product_best_title');
function bbloomer_storefront_product_best_title( $args ) {
$args['title'] = __( 'Most Sold', 'storefront' );
return $args;
}
How To Change Number of Best Selling Products
By default Storefront Best Selling section displays 4 products. Lets increase it to 12 products.
add_filter( 'storefront_best_selling_products_shortcode_args', 'bbloomer_storefront_best_product_per_page' );
function bbloomer_storefront_best_product_per_page( $args ) {
$args['per_page'] = 12;
return $args;
}
How To Add a Text Below Best Selling Products Section
This code snippet will let you add text or HTML depending on your need below the best selling section title. Just place PHP this snippet at the bottom of your child theme functions.php file before “?>”
add_action( 'storefront_homepage_after_best_selling_products_title', 'bbloomer_storefront_best_product_description' );
function bbloomer_storefront_best_product_description(){ ?>
echo "Section description here";
}