This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$push-top:2rem; | |
.push-top{ | |
margin-top: $push-top; | |
&.x2{ margin-top: $push-top*2;} | |
&.x3{ margin-top: $push-top*3;} | |
&.x4{ margin-top: $push-top*4;} | |
&.x5{ margin-top: $push-top*5;} | |
&.x6{ margin-top: $push-top*6;} | |
&.x7{ margin-top: $push-top*7;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bounds = new google.maps.LatLngBounds(); | |
var i; | |
// The Bermuda Triangle | |
var polygonCoords = [ | |
new google.maps.LatLng(25.774252, -80.190262), | |
new google.maps.LatLng(18.466465, -66.118292), | |
new google.maps.LatLng(32.321384, -64.757370), | |
new google.maps.LatLng(25.774252, -80.190262) | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Like get_template_part() put lets you pass args to the template file | |
* Args are available in the template as $template_args array | |
* @param string filepart | |
* @param mixed wp_args style argument list | |
*/ | |
function hm_get_template_part( $file, $template_args = array(), $cache_args = array() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$timezones = array( | |
'Pacific/Midway' => "(GMT-11:00) Midway Island", | |
'US/Samoa' => "(GMT-11:00) Samoa", | |
'US/Hawaii' => "(GMT-10:00) Hawaii", | |
'US/Alaska' => "(GMT-09:00) Alaska", | |
'US/Pacific' => "(GMT-08:00) Pacific Time (US & Canada)", | |
'America/Tijuana' => "(GMT-08:00) Tijuana", | |
'US/Arizona' => "(GMT-07:00) Arizona", | |
'US/Mountain' => "(GMT-07:00) Mountain Time (US & Canada)", | |
'America/Chihuahua' => "(GMT-07:00) Chihuahua", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HashTable = function() { | |
this._storage = []; | |
this._count = 0; | |
this._limit = 8; | |
} | |
HashTable.prototype.insert = function(key, value) { | |
//create an index for our storage location by passing it through our hashing function | |
var index = this.hashFunc(key, this._limit); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( has_term( array( 'laptop', 'fridge', 'hats', 'magic wand' ), 'product_cat' ) ) : | |
// Do stuff here | |
else : | |
// Do some other stuff | |
endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// place the following code in your theme's functions.php file | |
// Add a second password field to the checkout page. | |
add_action( 'woocommerce_checkout_init', 'wc_add_confirm_password_checkout', 10, 1 ); | |
function wc_add_confirm_password_checkout( $checkout ) { | |
if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) { | |
$checkout->checkout_fields['account']['account_password2'] = array( | |
'type' => 'password', | |
'label' => __( 'Confirm password', 'woocommerce' ), | |
'required' => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); | |
function custom_woocommerce_get_catalog_ordering_args( $args ) { | |
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
if ( 'random_list' == $orderby_value ) { | |
$args['orderby'] = 'rand'; | |
$args['order'] = ''; | |
$args['meta_key'] = ''; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* Sample instance based method. | |
*/ | |
class WC_Shipping_Test_Method extends WC_Shipping_Method { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$countries = array | |
( | |
'AF' => 'Afghanistan', | |
'AX' => 'Aland Islands', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', | |
'AD' => 'Andorra', |