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
function oo_custom_login_logo() { | |
?> | |
<style type="text/css"> | |
body.login{ | |
background: #1D1D1D; | |
} | |
body.login p#backtoblog{ | |
display: none; | |
} | |
body.login p#nav a, |
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
//Woocommerce Checkout JS events | |
$( document.body ).trigger( 'init_checkout' ); | |
$( document.body ).trigger( 'payment_method_selected' ); | |
$( document.body ).trigger( 'update_checkout' ); | |
$( document.body ).trigger( 'updated_checkout' ); | |
$( document.body ).trigger( 'checkout_error' ); | |
//Woocommerce cart page JS events | |
$( document.body ).trigger( 'wc_cart_emptied' ); | |
$( document.body ).trigger( 'update_checkout' ); |
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
DELETE relations.*, taxes.*, terms.* | |
FROM wp_term_relationships AS relations | |
INNER JOIN wp_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product'); | |
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product'); | |
DELETE FROM wp_posts WHERE post_type = 'product'; |
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
/** | |
* Snippet Name: List taxonomies by initial letter | |
* Snippet URL: http://www.wpcustoms.net/snippets/list-taxonomies-by-initial-letter/ | |
*/ | |
$list = ''; | |
$args = array( | |
'hide_empty' => true, | |
); | |
$tags = get_terms('CUSTOM-TAXONOMY',$args); |
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
body { | |
background-image: | |
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><linearGradient id='gradient'><stop offset='10%' stop-color='%23F00'/><stop offset='90%' stop-color='%23fcc'/> </linearGradient><rect fill='url(%23gradient)' x='0' y='0' width='100%' height='100%'/></svg>"); | |
} | |
/* | |
Note that the SVG content needs to be url-escaped for this to work, e.g. # gets replaced with %23. | |
*/ |
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
//return thumbnail for youtube and vimeo | |
function video_image($url){ | |
$image_url = parse_url($url); | |
if($image_url['host'] == 'www.youtube.com' || $image_url['host'] == 'youtube.com'){ | |
$array = explode('&', $image_url['query']); | |
return 'http://img.youtube.com/vi/'.substr($array[0], 2).'/0.jpg'; | |
} else if($image_url['host'] == 'www.vimeo.com' || $image_url['host'] == 'vimeo.com'){ | |
$hash = unserialize(curl_get_file_contents('http://vimeo.com/api/v2/video/'.substr($image_url['path'], 1).'.php')); | |
return $hash[0]['thumbnail_small']; | |
} |
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_payment_complete_order_status', 'wc_auto_complete_paid_order', 10, 3 ); | |
function wc_auto_complete_paid_order( $status, $order_id, $order ) { | |
return 'completed'; | |
} |
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
//https://css-tricks.com/how-to-write-loops-with-preprocessors/ | |
//for | |
@for $i from 1 through 15 { | |
div { | |
&:nth-child(#{$i}) { | |
&::after { | |
content: "#{$i}"; | |
} | |
} |
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
function disable_unnecessary_notification( $value ) { | |
if ( isset( $value ) && is_object( $value ) ) { | |
unset( $value->response['Impreza'] ); | |
} | |
return $value; | |
} | |
add_filter( 'site_transient_update_themes', 'disable_unnecessary_notification' ); | |
function filter_plugin_updates( $value ) { | |
unset( $value->response['facetwp/index.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
billing_wcj_checkout_field_1 | |
<?php | |
add_action('woocommerce_after_checkout_form', function($checkout){ | |
?> | |
<script type="text/javascript"> | |
jQuery(function($){ | |
$(document).on('change','#billing_wcj_checkout_field_1',function(){ | |
$(document.body).trigger("update_checkout"); |
OlderNewer