Skip to content

Instantly share code, notes, and snippets.

View duellingpixels's full-sized avatar

Nicholas Duell duellingpixels

View GitHub Profile
<?php
// Add min value to the quantity field (default = 1)
add_filter('woocommerce_quantity_input_min', 'min_decimal');
function min_decimal($val) {
if ( is_shop() || is_shop() && is_product_category( array( 'seasonal-local-vegetables', 'seasonal-local-organic-produce', 'local-seasonal-fruit') ) || is_product_category( array( 'seasonal-local-vegetables', 'seasonal-local-organic-produce', 'local-seasonal-fruit') )) {
return 0.5;
}
}
<?php
/**
* My Account page
*
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-account.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
require_once( get_stylesheet_directory() . '/lib/customizer_google_fonts.php' );
Photo credit: <a href="https://duellingpixels.com/" target="_blank" alt="Duellingpixels" >Duelling Pixels</a>
@duellingpixels
duellingpixels / woocommerce_menu_genesis.php
Created March 9, 2016 01:59
Add a woocommerce shop menu on a genesis themed website.
// Shop Menu
function themprefix_shop_menu () {
if ( is_woocommerce() || is_shop() || is_cart() || is_checkout() || is_account_page () || is_view_order_page() || is_product() ) {
echo '<div id="nav-header-shop" class="shop-menu-container ">';
$args = array(
'theme_location' => 'shop',
'container' => 'nav',
<?php
//* Remove the post navigation (requires HTML5 theme support)
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
/** Replace the standard loop with our author loop */
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'dp_author_info', 20);
/**