View YDCOZA-GIST-VERIFY
This file contains 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
Verifying that "johnmontgomery.id" is my Blockstack ID. https://onename.com/johnmontgomery |
View gist:9721046
This file contains 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 the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
/** |
View gist:9721045
This file contains 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_billing_fields', 'custom_woocommerce_billing_fields' ); | |
function custom_woocommerce_billing_fields( $fields ) { | |
// Over-ride a single label | |
$fields['billing_first_name']['label'] = 'Your label'; | |
// Over-ride a single required value | |
$fields['billing_first_name']['required'] = false; |
View mediaelements
This file contains 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
/*----------------------------------------LAUDES----------------------------------------*/ | |
/* Mediaelements Controls */ | |
/*--------------------------------------------------------------------------------------*/ | |
.hentry .mejs-mediaelement, | |
.hentry .mejs-container .mejs-controls { | |
background: #191919; | |
} | |
.hentry .mejs-controls .mejs-time-rail .mejs-time-loaded, |
View the-slug.php
This file contains 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 | |
function the_slug() { | |
$post_data = get_post($post->ID, ARRAY_A); | |
$slug = $post_data['post_name']; | |
return $slug; | |
} | |
?> | |
Once done, simply call the function within the loop to get the post or page slug. |
View ratings
This file contains 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
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); |
View out-of-stock
This file contains 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_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_out_stock', 10); | |
function woocommerce_template_loop_out_stock() { | |
global $product; | |
if ( ! $product->managing_stock() && ! $product->is_in_stock() ) | |
echo '<p class="stock out-of-stock">Out of stock</p>'; | |
} |
View functions.php
This file contains 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 | |
/** | |
* Hook in on activation | |
*/ | |
global $pagenow; | |
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 ); | |
/** | |
* Define image sizes | |
*/ |
View virtualmin-centos6-backup-to-dropbox
This file contains 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
# Backing Up To DropBox just sounds "cool" so here we go ::: I'm running a Centos 6 VPN with Webmin and Virtualmin GPL install, with "reseller" accounts ( not that I sell, I just like the functionality ) so I needed a way to create nightly BU's of each account ::: Below are some links I found very handy ::: | |
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh root@888.88.88.88 where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial ::: | |
# Resource | |
# http://kiteplans.info/2012/03/26/centos-virtualmin-server-backups-dropbox/ ( Centos ) | |
# http://www.dropboxwiki.com/Using_Dropbox_CLI | |
# https://whatbox.ca/wiki/Dropbox ( Ubuntu ) |
NewerOlder