Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidWells/9064319 to your computer and use it in GitHub Desktop.
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
/* 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