Skip to content

Instantly share code, notes, and snippets.

View jameskoster's full-sized avatar
🍕

James Koster jameskoster

🍕
View GitHub Profile
@jameskoster
jameskoster / storefront-logo-size-adjust-example.css
Last active February 24, 2020 11:51 — forked from mattyza/storefront-logo-size-adjust-example.css
Adjust the dimensions of the header logo in the Storefront theme.
@media screen and (min-width: 768px) {
.site-header .site-branding, .site-header .site-logo-anchor, .site-header .site-logo-link, .site-header .custom-logo-link {
width: 21%; /* Adjust this percentage up or down to make the logo larger or smaller. */
}
}
@jameskoster
jameskoster / functions.php
Last active February 5, 2017 22:02 — forked from mikejolley/functions.php
WooCommerce - change number of upsells displayed and number of columns
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 15 );
if ( ! function_exists( 'woocommerce_output_upsells' ) ) {
function woocommerce_output_upsells() {
woocommerce_upsell_display( 3,3 ); // Display 3 products in rows of 3
}
}
@jameskoster
jameskoster / functions.php
Last active August 31, 2021 14:18 — forked from mikejolley/functions.php
WooCommerce - Exclude products from a particular category on the shop page
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! is_admin() && is_shop() ) {
$q->set( 'tax_query', array(array(