This file contains hidden or 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 | |
/** | |
* Must-Use Functions | |
* | |
* A class filled with functions that will never go away upon theme deactivation. | |
* | |
* @package WordPress | |
* @subpackage GRD | |
*/ | |
class GRD_Functions { |
This file contains hidden or 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
/** | |
* Be sure to include library scripts in this order. Can be placed either | |
* in the header or footer. | |
*/ | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script> |
This file contains hidden or 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 OPENING PHP TAG | |
/** | |
* Customize the excerpt length and strip tags | |
*/ | |
function custom_excerpt ( $text ) { | |
global $post; |
This file contains hidden or 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' ); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
// Criteo Thank you page - Sales Confirmation page | |
add_action( 'woocommerce_thankyou', 'criteo_tracking_cart', 80 ); | |
function criteo_tracking_cart( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$order_nr = $order->get_order_number(); | |
$order_email = get_user_meta( $order->user_id, 'billing_email', true ); | |
$source_address = $order_email; | |
$processed_address = strtolower($source_address); //convert address to lower case |
This file contains hidden or 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 | |
// Adtraction conversion tracking implementation | |
add_action( 'woocommerce_thankyou', 'adtraction_tracking', 60 ); | |
function adtraction_tracking( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$order_nr = $order->get_order_number(); | |
$order_total_shipping = $order->get_total_shipping(); | |
$order_total_ex_vat = $order->get_total() - $order->get_total_tax(); | |
$order_total = $order_total_ex_vat - $order_total_shipping; | |
$order_email = get_user_meta( $order->user_id, 'billing_email', true ); |
This file contains hidden or 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
/*-------------------------------------------------------------------------*/ | |
/* Gravity Forms | |
/*-------------------------------------------------------------------------*/ | |
.gform_wrapper { | |
input[type=text], | |
input[type=url], | |
input[type=email], | |
input[type=tel], | |
input[type=number], |