Assuming you have Python installed on your system:
pip install twisted
pip install pyOpenSSL
pip install service_identity
// not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
// BTC Donations to: bc1q0cwjuxxqqmwnxxc0m2xkkyf4kes9e0gejc9u0l | |
/** | |
* Add a .27 surcharge to orders shipping to Colorado | |
*/ | |
add_action('woocommerce_cart_calculate_fees', 'handsome_bearded_guy_custom_surcharge'); | |
function handsome_bearded_guy_custom_surcharge() { | |
global $woocommerce; |
String.prototype.ucwords = function() { | |
str = this.toLowerCase(); | |
return str.replace(/(^([a-zA-Z\p{M}]))|([ -][a-zA-Z\p{M}])/g, | |
function(s){ | |
return s.toUpperCase(); | |
}); | |
}; |
function is_blog () { | |
global $post; | |
$posttype = get_post_type($post ); | |
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; | |
} | |
Usage: | |
<?php if (is_blog()) { echo 'You are on a blog page'; } ?> |