Skip to content

Instantly share code, notes, and snippets.

@RiaanKnoetze
RiaanKnoetze / functions.php
Created November 8, 2017 06:25
Change the number of categories and the order on the homepage when using Storefront
add_filter('storefront_product_categories_shortcode_args','custom_storefront_category_per_page' );
// Category Products
function custom_storefront_category_per_page( $args ) {
$args['number'] = 10;
$args['orderby'] = 'name';
return $args;
}
@RiaanKnoetze
RiaanKnoetze / functions.php
Created November 7, 2017 03:41
Change the orderby parameter for the Featured Products section in Storefront for WooCommerce
add_filter('storefront_featured_products_args','custom_storefront_featured_product_order' );
// Featured Products Order
function custom_storefront_featured_product_order( $args ) {
$args['orderby'] = 'title;
return $args;
}
@RiaanKnoetze
RiaanKnoetze / style.css
Created August 2, 2017 08:57
Remove the padding and margin of the page content on the homepage when using Storefront.
.page-template-template-homepage.has-post-thumbnail .type-page.has-post-thumbnail {
padding-top: 0;
padding-bottom: 0;
margin: 0;
}
@RiaanKnoetze
RiaanKnoetze / style.css
Created July 31, 2017 18:01
Force background header image in Canvas to always scale with width of header.
#header {
background-size: contain;
}
@RiaanKnoetze
RiaanKnoetze / style.css
Created June 18, 2017 20:02
Change positioning of category text when using WooCommerce's Outlet theme
.page-template-template-homepage-php .storefront-product-categories ul.products li.product h3,
.page-template-template-homepage-php .storefront-product-categories ul.products li.product h2,
.page-template-template-homepage-php .storefront-product-categories ul.products li.product .woocommerce-loop-product__title {
position: relative;
}
@RiaanKnoetze
RiaanKnoetze / style.css
Created June 5, 2017 11:28
Permanently show the product title and prices when using the Storefront Homestore page
.site-main ul.products li.product .button,
.site-main ul.products li.product .g-product-title,
.smm-mega-menu ul.products li.product .button,
.smm-mega-menu ul.products li.product .g-product-title {
opacity: 1;
}
@RiaanKnoetze
RiaanKnoetze / style.css
Created May 29, 2017 07:13
Hide product count/mark next to category titles when using WooCommerce
.woocommerce mark {
display: none;
}
@RiaanKnoetze
RiaanKnoetze / style.css
Last active June 14, 2017 03:27
Permanently show the product details on the shop page when using Galleria
.site-main ul.products li.product, .smm-mega-menu ul.products li.product {
overflow: visible;
}
.site-main ul.products li.product .button,
.site-main ul.products li.product .g-product-title,
.smm-mega-menu ul.products li.product .button,
.smm-mega-menu ul.products li.product .g-product-title {
position: relative;
display: block;
@RiaanKnoetze
RiaanKnoetze / style.css
Created May 14, 2017 19:08
Change header height when using the One Pager theme from WooThemes.
body.has-top-nav #header {
padding-top: 4.505em;
}
#header #logo, #header #hgroup {
margin-bottom: 0;
}
@RiaanKnoetze
RiaanKnoetze / style.css
Created May 10, 2017 03:43
Hide the page icon on the mobile menu when using WooCommerce's Storefront theme
.main-navigation ul li a:before {
display: none;
}