Last active
August 29, 2015 13:56
-
-
Save DavidWells/9064319 to your computer and use it in GitHub Desktop.
Turn off landing page javascript on non landing page post types. Warning: This will break lead tracking for other pages
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
/* Fair warning this will break page tracking */ | |
add_action( ‘wp_print_scripts’, ‘turn_off_lp_script’, 120 ); | |
function turn_off_lp_script(){ | |
global $post; | |
if (isset($post) && $post->post_type != 'landing-page') { | |
wp_dequeue_script( ‘jquery-cookie’ ); | |
wp_deregister_script( ‘jquery-total-storage’ ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment