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 | |
/* ADD GTM TO HEAD AND BELOW OPENING BODY */ | |
add_action('wp_head', 'google_tag_manager_head', 20); | |
function google_tag_manager_head() { ?> | |
<!-- Google Tag Manager --> | |
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
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
/* BCC Email for orders completed for WooCommerce version 2.3 and above */ | |
add_filter( 'woocommerce_email_headers', 'es_headers_filter_function', 10, 3); | |
function es_headers_filter_function( $headers, $id, $object ) { | |
if ($id == 'customer_completed_order') { | |
$headers .= 'BCC: Trustpilot <xxxxx@invite.trustpilot.com>' . "\r\n"; | |
} | |
return $headers; | |
} |
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
// These mixins make media queries a breeze with SCSS. | |
// The media queries from mobile up until desktop all trigger at different points along the way. | |
// This helper is focused on mobile first. You style your block as it whould appear in mobile and then add CSS for how it scales up. | |
// | |
// Example | |
// .block { | |
// height: 250px; | |
// | |
// @include MQ(M) { | |
// height: 300px; |
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
// Dynamic Purchase Tracking Code - Thank you page | |
function thankyou_tracking( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$order_total = $order->get_total(); | |
$order_nr = $order->get_order_number(); | |
?> | |
<!-- Tracking Code --> | |
<?php echo $order_nr; ?> | |
<?php echo $order_total; ?> |
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
//Strip unwanted product categories in categories loop on single product page and/or woocommerce loop | |
//Add this manually to your wanted hook or filter | |
function list_clean_categories() { | |
global $post; | |
$terms = get_the_terms( $post->ID, 'product_cat' ); | |
$unwanted_cat_slugs = array(); | |
//Example: $unwanted_cat_slugs[] = "campaign-summer"; | |
$unwanted_cat_slugs[] = "xxx"; | |
$unwanted_cat_slugs[] = "yyy-yyy"; |
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
// Facebook tracking pixel on Thank you page | |
function fb_pixeltracking( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$order_total = $order->get_total(); | |
?> | |
<!-- Facebook Conversion Code --> | |
<script>(function() { | |
var _fbq = window._fbq || (window._fbq = []); | |
if (!_fbq.loaded) { |
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
// These text rendering optimization settings are default on all our sites from 2016. | |
body { | |
-moz-font-smoothing: antialiased; | |
-webkit-font-smoothing: antialiased; | |
text-rendering: optimizeLegibility; | |
/* Recommended default font-size and line-height */ | |
line-height: 1.5; | |
font-size: 16px; |
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( 'gform_ajax_spinner_url', 'cwwp_custom_gforms_spinner' ); | |
/** | |
* Changes the default Gravity Forms AJAX spinner. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $src The default spinner URL | |
* @return string $src The new spinner URL | |
*/ | |
function cwwp_custom_gforms_spinner( $src ) { |
OlderNewer