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 | |
/* Shortcode to Display Markers in functions.php | |
=============================================================== */ | |
function cmm_markers_shortcode( $atts, $content = null ) { | |
$args = array( 'post_type' => 'marker', | |
'posts_per_page' => -1, | |
'post_status' => 'publish', | |
'suppress_filters' => true | |
); | |
$markers = new WP_Query( $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
<?php | |
/* Enqueuing Scripts in functions.php | |
=============================================================== */ | |
function cmm_scripts() { | |
wp_enqueue_script( 'cmm-js', get_stylesheet_directory_uri() . '/js/cmm.js', array('jquery'), '1.0', true); | |
} | |
add_action( 'wp_enqueue_scripts', 'cmm_scripts' ); |
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
var gaProperty = 'UA-XXXXXXXX-Y'; | |
var disableStr = 'ga-disable-' + gaProperty; | |
// checking for opt-out cookie on document and applying to window if set | |
if (document.cookie.indexOf(disableStr + '=true') > -1) { | |
window[disableStr] = true; | |
} | |
// user is opting out, setting cookie on document, window and alerting success | |
function gaOptout() { | |
document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/'; | |
window[disableStr] = true; |
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
<script> | |
(function( $ ) { | |
$( '.fusion-logo-link > img' ).attr('src', '/wp-content/uploads/2018/01/special-logo.png').attr('srcset', '/wp-content/uploads/2018/01/special-logo.png 1x, /wp-content/uploads/2018/01/special-logo.png 2x').attr('retina_logo_url', '/wp-content/uploads/2018/01/special-logo.png'); | |
})( jQuery ); | |
</script> |
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 | |
/* Prevent Google Fonts from loading | |
=============================================================== */ | |
function prevent_loading_fonts() { | |
remove_action('wp_enqueue_scripts', 'et_divi_load_fonts'); | |
} | |
add_action( 'init', 'prevent_loading_fonts', 20 ); | |
function et_builder_get_google_fonts() { return array(); } | |
function et_get_google_fonts() { 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
<script id="gist0"> | |
(function( $ ) { | |
if ( has_consent( 'github' ) ){ | |
$.getJSON( 'https://gist.github.com/cubehrends/1f316da01358e85f3592742327f0d83a.json?callback=?', function( data ) { | |
$('#gist0').parent().html( $( data.div ) ).append('<link rel="stylesheet" href="' + data.stylesheet + '">') | |
} ) | |
} else { |
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 | |
/* the code below goes into your child themes functions.php | |
=============================================================== */ | |
function customize_comment_form_cookies_consent_label( $translated, $original, $domain ) { | |
$strings = array( | |
'Save my name, email, and website in this browser for the next time I comment.' => '=> YOUR CUSTOMIZED TEXT GOES HERE <=' | |
); | |
if ( ! empty( $strings[$original] ) ) { |
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 ( $_GET ) { | |
$lang = set_lang( key($_GET) ); | |
} else if ( isset($_COOKIE['lang']) ) { | |
$lang = $_COOKIE['lang']; | |
} else { | |
$lang = set_lang( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) ); | |
} | |
function set_lang( $l ) { |
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 | |
function register_pll_strings() { | |
if( !function_exists( 'pll_register_string' ) ) return; // go away if polylang not active | |
pll_register_string('Policy Accept', 'I read your', 'CommentForm'); | |
pll_register_string('Privacy Policy', 'Privacy Policy', 'CommentForm'); | |
pll_register_string('Policy Page', 'privacy', 'CommentForm'); | |
pll_register_string('Error', 'ERROR', 'CommentForm'); |