Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jamesmthornton/9b42137f98224679410307d262868508 to your computer and use it in GitHub Desktop.
Save jamesmthornton/9b42137f98224679410307d262868508 to your computer and use it in GitHub Desktop.
Remove Intercom Snippet ONLY on Blog Posts in Wordpress
<?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