Created
July 8, 2017 20:00
-
-
Save jamesmthornton/9b42137f98224679410307d262868508 to your computer and use it in GitHub Desktop.
Remove Intercom Snippet ONLY on Blog Posts in Wordpress
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 | |
// conditionally remove the intercom snippet from wp_footer for posts but not pages | |
add_action('wp_enqueue_scripts','remove_intercom_blog_posts'); | |
function remove_intercom_blog_posts () { | |
if ( is_single() ) { | |
remove_action( 'wp_footer', 'add_intercom_snippet' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment