21 tips and CSS tricks for WooCommerce Storefront


21 tips, tricks and CSS tweaks for WooCommerce Storefront

These WooCommerce Storefront theme tweaks have been curated from the most common questions we’ve found on the web. We really hope you find them useful. We’ll be adding to them over the coming months. We recommend that you use a child theme for these 21 tips and CSS tricks for WooCommerce Storefront and we’ve created a free blank WooThemes Storefront child theme for you here.

If you have any questions, please post them in the comments box below :)

Storefront Pro now makes customizing the WooCommerce theme incredibly easy

We’ve now released a plugin called Storefront Pro. This lets you easily customize and modify the WooCommerce Storefront.

CLICK HERE TO READ MORE ABOUT STOREFRONT PRO.

Either watch the full video, or use the shortcuts below that link specific areas.

And here are your tweaks

NEW TIP! How to create a beautiful fullscreen Storefront website

Here’s a new tutorial on how to create a fullscreen website like the one below.

Click here to view the WooThemes Storefront fullscreen tutorial

WooThemes Storefront fullscreen website tutorial

How to remove the underline from Hyperlinks

In version 2.4.5 of the Storefront, theme links are underlined by default. If you want to remove them then the following CSS will do it for you. 

a {
text-decoration: none !important;
}

How to change the colour of the Horizontal lines on the Storefront homepage

Simply add the following code to your child theme’s custom.css file. Thanks to James Koster for this one

.page-template-template-homepage .hentry .entry-header,.page-template-template-homepage .hentry,.page-template-template-homepage .storefront-product-section {border-color: red;}view rawgistfile1.txt hosted with  by GitHub

How to style widgets

Add and amend the following css to your child theme’s custom.css file

.widget-area .widget {
color: red;
font-size: 1em;
}

How to customize the Storefront WooCommerce on sale badge

Add the following code to your child theme’s custom.css file.

.onsale {
background-color: #FFFFFF;
border-color: #FF0000;
color: #FF0000;
}

How to move the sale badge (i.e below the product picture)

Add the following code to your child theme’s custom.css file.

ul.products li.product .onsale {
position: absolute;
top: 137px;
right: 62px;
}

 by GitHubThanks to Nicola Mustone for this one

How to the change the size of the logo, secondary navigation and search bar

Add the following code to your child theme’s custom.css file.

@media screen and (min-width: 768px) {
/* LOGO */
.site-header .site-branding, .site-header .site-logo-anchor, .site-header .site-logo-link { width: 30% !important; /* Use px values if you want, eg. 350px */ }
/* SECONDARY NAVIGATION */
.site-header .secondary-navigation { width: 40% !important; /* Use px values if you want, eg. 350px */ }
/* SEARCH BAR */
.site-header .site-search { width: 30% !important; /* Use px values if you want, eg. 350px */ }
}

Thanks again to Nicola Mustone for this one

How to Remove the sidebar on WooCommerce product pages to go full width

Add the following code to your child theme’s functions.php file.

add_action( 'get_header', 'remove_storefront_sidebar' );
if ( is_product() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
}
}
body.woocommerce #primary { width: 100%; }

Thanks to Matty Cohen for this one

How to align your menu to the right of the logo on Storefront

We’ve developed a free plugin that will do this for you. You can get our free Storefront Align Menu right extension here.

How to add a top bar to Storefont (for cool things like social icons or a welcome message)

Open you child theme’s functions.php file and paste the following code in.

<?php
/**
* Adds a top bar to Storefront, before the header.
*/
function storefront_add_topbar() {
?>
<div id="topbar">
<div class="col-full">
<p>Your text here</p>
</div>
</div>
<?php
}
add_action( 'storefront_before_header', 'storefront_add_topbar' );
#topbar {
background-color: #1F1F20;
height: 40px;
line-height: 40px;
}
#topbar p {
color: #fff;
}

How to add a custom message to your top bar

Find the code that you used when you created the top bar (see the previous tweak).

Replace with this

<?php
/**
* Adds a top bar to Storefront, before the header.
*/
function storefront_add_topbar() {
global $current_user;
get_currentuserinfo();
if ( ! empty( $current_user->user_firstname ) ) {
$user = $current_user->user_firstname;
} else {
$user = __( 'guest', 'storefront-child' );
}
?>
<div id="topbar">
<div class="col-full">
<p>Welcome <?php echo $user ?>!</p>
</div>
</div>
<?php
}
add_action( 'storefront_before_header', 'storefront_add_topbar' );

How to make Meta Slider full width with Storefont

Meta slider is one of the most popular free sliders available on WordPress.org. This bit of code will stretch the slider to be full width. Add this code to your child theme’s functions.php

add_action( 'init', 'child_theme_init' );
function child_theme_init() {
add_action( 'storefront_before_content', 'woa_add_full_slider', 5 );
}
function woa_add_full_slider() { ?>
<div id="slider">
<?php echo do_shortcode("[metaslider id=388 percentwidth=100]"); ?>
</div>
<?php
}

How to add extra Google Fonts to Storefront

Here’s a great plugin that will do this for you. Visit the Google Fonts WordPress plugin.

How to remove the search bar from the header

Add this code to your child theme’s functions.php

add_action( 'init', 'jk_remove_storefront_header_search' );
function jk_remove_storefront_header_search() {
remove_action( 'storefront_header', 'storefront_product_search', 40 );
}

view rawadd_action( 'init', 'jk_remove_storefront_header_search' ); function jk_remove_storefront_header_search() { remove_action( 'storefront_header', 'storefront_product_search', 40 ); } hosted with 

How to hide the Page Titles in Storefront

Chat on WhatsApp

Copyright © 2024 Greatmike – Greatmike Foundation