Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew AndrewSepic

View GitHub Profile
@woogists
woogists / wc-min-order-amount.php
Last active Aug 19, 2021
Set a minimum order amount for checkout
View wc-min-order-amount.php
/**
* Set a minimum order amount for checkout
*/
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 50;
@djp424
djp424 / wp-config-mutisite-debug.php
Created Oct 20, 2014
How to turn WordPress Debug on for a single site in a MultiSite Install. From https://wordpress.org/support/topic/debugging-multisite-blogs put this in wp-config.php
View wp-config-mutisite-debug.php
if ($_SERVER['HTTP_HOST']=='site1.example.com')
define('WP_DEBUG', true);
else
define('WP_DEBUG', false);
@patrickgilmour
patrickgilmour / woocommerce-simple-or-variable.php
Created Jun 27, 2014
WooCommerce conditional to test if a Product is Simple or Variable.
View woocommerce-simple-or-variable.php
<?php
/**
* Is a WooCommerce Product Simple or Variable
*
* see http://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable
*/
if( $product->is_type( 'simple' ) ){
// a simple product
@About2git
About2git / archive-books.php
Last active Nov 17, 2020 — forked from srikat/archive-books.php
Single and Archive templates for Custom Post Type in Genesis
View archive-books.php
<?php
//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
//* Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove entry meta in entry header
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );