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() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
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
/* Critical CSS Finder w/media query support and output to console | |
by Katie Harron - https://github.com/pibby - https://pibby.com | |
forked from james-Ballyhoo (https://gist.github.com/james-Ballyhoo/04761ed2a5778c505527) who forked from PaulKinlan (https://gist.github.com/PaulKinlan/6284142) | |
I don't know why this isn't keeping my 2 space indents :( | |
*/ | |
(function() { | |
function findCriticalCSS(w, d) { | |
// Pseudo classes formatting | |
var formatPseudo = /([^\s,\:\(])\:\:?(?!not)[a-zA-Z\-]{1,}(?:\(.*?\))?/g; |
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
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { | |
text-align: center; | |
padding: 150px; | |
} | |
h1 { | |
font-size: 50px; |
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_cart_calculate_fees','custom_tax_surcharge_for_retailers', 10, 1 ); | |
function custom_tax_surcharge_for_retailers( $cart ) { | |
if ( is_admin() && ! defined('DOING_AJAX') ) return; | |
global $woocommerce; | |
if ( isset( $_POST['post_data'] ) ) { | |
parse_str( $_POST['post_data'], $post_data ); | |
} else { | |
$post_data = $_POST; | |
} |
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 the text {PHP} | |
add_filter( 'woocommerce_product_add_to_cart_text', 'change_text_woo' ); | |
function change_text_woo() { | |
return; | |
} | |
//add the icon {CSS} | |
a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart:after { | |
content: "\f111"; | |
font-family: dashicons; |
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 post_change_expired_function_new () { | |
if (is_admin()): | |
return; | |
endif; | |
if (is_single()): | |
$offer_coupon_date = get_post_meta( $post->ID, 'rehub_offer_coupon_date', true ); | |
$timestamp1 = strtotime($offer_coupon_date) + 86399; | |
$seconds = $timestamp1 - (int)current_time('timestamp',0); | |
$days = floor($seconds / 86400); | |
$seconds %= 86400; |
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 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> | |
<?php global $post;?> | |
<?php | |
$columns = (isset($columns)) ? $columns : ''; | |
$aff_link = (isset($aff_link)) ? $aff_link : ''; | |
if(!isset($disable_btn)){ | |
$disable_btn = (rehub_option('rehub_enable_btn_recash') == 1) ? 0 : 1; | |
} | |
$gridtype = (isset($gridtype)) ? $gridtype : ''; | |
if(rehub_option('disable_btn_offer_loop')){ |
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_product_tabs', 'vagelis_dev_merge_tabs', 99 ); | |
function vagelis_dev_merge_tabs( $tabs ) { | |
$tabs['description']['callback'] = function() { | |
global $product; | |
the_content(); | |
do_action( 'woocommerce_product_additional_information', $product ); | |
}; | |
unset( $tabs['additional_information'] ); | |
return $tabs; |
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
jQuery(document).ready(function() { | |
jQuery("[id^=quform_10_218_]").change(function(event) { | |
jQuery("[id^=quform_10_1]") | |
.find("option:selected") | |
.removeAttr("selected"); | |
jQuery("[id^=quform_10_1]").val(""); | |
jQuery("[id^=quform_10_1]").change(); | |
jQuery("[id^=quform-form]").closest('form').trigger("reset"); | |
}); | |
}); |
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
/** | |
* Exclude products from a particular category on the shop page | |
*/ | |
function hide_products_in_unc( $q ) { | |
$tax_query = (array) $q->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', | |
'terms' => array( 'uncategorized' ), | |
'operator' => 'NOT IN' |
OlderNewer