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
//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 ) { |
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
//Use <div class="box box-shadow"> for a nice hover effect. | |
//@requires our _media-queries.scss | |
//Available classes <div class="box box-rounded box-border box-rounded box-shadow"> | |
.box { | |
background-color: #fff; | |
overflow: hidden; | |
&.box-no-padding { | |
padding: 0; |
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
/** | |
* Browser and OS detection | |
* @link http://www.wpbeginner.com/wp-themes/how-to-add-user-browser-and-os-classes-in-wordpress-body-class/ | |
*/ | |
function dxms_browser_os_body_class( $classes ) { | |
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; | |
if( $is_lynx ) $classes[] = 'lynx'; | |
elseif( $is_gecko ) $classes[] = 'gecko'; |
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 | |
/** | |
* Filter the Products CPT to register more options. | |
* | |
* @param $args array The original CPT args. | |
* @param $post_type string The CPT slug. | |
* | |
* @return array | |
*/ |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
/** | |
* Remove emoji support. | |
*/ | |
function grd_remove_emoji() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
OlderNewer