Skip to content

Instantly share code, notes, and snippets.

View jameskoster's full-sized avatar
🍕

James Koster jameskoster

🍕
View GitHub Profile
@media screen and (max-width: 768px) {
/* Target mobile devices only */
ul.products li.product {
width: 48%;
clear: both;
float: left;
}
ul.products li.product:nth-child(2n) {
clear: none;
@jameskoster
jameskoster / social.css
Created April 30, 2015 12:44
Storefront social icons in secondary nav
.secondary-navigation a[href*="dribbble.com"], .secondary-navigation a[href*="facebook.com"], .secondary-navigation a[href*="flickr.com"], .secondary-navigation a[href*="foursquare.com"], .secondary-navigation a[href*="plus.google.com"], .secondary-navigation a[href*="instagram.com"], .secondary-navigation a[href*="linkedin.com"], .secondary-navigation a[href*="pinterest.com"], .secondary-navigation a[href*="reddit.com"], .secondary-navigation a[href*="tumblr.com"], .secondary-navigation a[href*="twitter.com"], .secondary-navigation a[href*="vimeo.com"], .secondary-navigation a[href*="wordpress.com"], .secondary-navigation a[href*="wordpress.org"], .secondary-navigation a[href*="youtube.com"], .secondary-navigation a[href*="mailto:"], .secondary-navigation a[href*="twitch.tv"], .secondary-navigation a[href$="/feed/"] {
text-indent: -9999px; }
.secondary-navigation a[href*="dribbble.com"]:after, .secondary-navigation a[href*="facebook.com"]:after, .secondary-navigation a[href*="flickr.com"]:after, .seconda
@jameskoster
jameskoster / style.css
Created March 20, 2015 11:19
Book Store - Content area
.left-sidebar .content-area {
margin-left: 0;
margin-right: 0;
width: 74%;
}
.page-template-template-fullwidth-php .content-area,
.page-template-template-homepage-php .content-area,
.storefront-full-width-content .content-area {
margin-left: 0;
@jameskoster
jameskoster / widget.html
Created February 3, 2015 12:09
Storefront - header bar
<div style="text-align: center; background: #000; color: #fff; padding: .53em; font-weight: bold;">
<span style="margin: 0 1em;">Check out our new Jackets!</span>
<span style="margin: 0 1em;">Get 25% off your first order!</span>
<span style="margin: 0 1em;">Free shipping on all orders over $100!</span>
</div>
@jameskoster
jameskoster / functions.php
Created January 26, 2015 13:41
Storefront - Change Primary Navigation text on nav button toggle
add_filter( 'storefront_menu_toggle_text', 'jk_storefront_menu_toggle_text' );
function jk_storefront_menu_toggle_text( $text ) {
$text = __( 'Navigation' );
return $text;
}
@jameskoster
jameskoster / functions.php
Created December 2, 2014 09:10
Storefront - add a custom logo
add_action( 'init', 'storefront_custom_logo' );
function storefront_custom_logo() {
remove_action( 'storefront_header', 'storefront_site_branding', 20 );
add_action( 'storefront_header', 'storefront_display_custom_logo', 20 );
}
function storefront_display_custom_logo() {
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="site-logo-link" rel="home">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php echo get_bloginfo( 'name' ); ?>" />
@jameskoster
jameskoster / functions.php
Created November 17, 2014 17:15
WooCommerce - hide variable product price range
function jk_variable_product_price( $price ) {
global $product;
$product = new WC_Product_Variable( $product );
$min_price = $product->get_variation_price( 'min', true );
$max_price = $product->get_variation_price( 'max', true );
// Hide the range if the min/max price doesn't match
if ( $min_price !== $max_price ) {
$price = '';
@jameskoster
jameskoster / functions.php
Created November 11, 2014 09:53
Storefront - Only display post excerpt on archives
add_action( 'init', 'jk_customise_storefront' );
function jk_customise_storefront() {
// Remove the storefromt post content function
remove_action( 'storefront_loop_post', 'storefront_post_content', 30 );
// Add our own custom function
add_action( 'storefront_loop_post', 'jk_custom_storefront_post_content', 30 );
}
@jameskoster
jameskoster / functions.php
Created October 21, 2014 13:55
Subscribe and Connect adjust social network markup to include nofollow
add_filter( 'subscribe_and_connect_networks_list', 'jk_change_social_links_markup' );
function jk_change_social_links_markup( $list ) {
global $subscribe_and_connect;
$settings = $subscribe_and_connect->get_settings();
$networks = Subscribe_And_Connect_Utils::get_networks_in_order( $settings['connect']['networks'], $settings['connect']['networks_order'] );
$list = '';
if ( 0 < count( $networks ) ) {
foreach ( $networks as $k => $v ) {
if ( ! isset( $v['url'] ) || '' == $v['url'] ) continue;
@jameskoster
jameskoster / functions.php
Created July 15, 2014 13:33
Zephyr - disable header gravatar
add_filter( 'zephyr_header_gravatar', '__return_false' );