Stop Disqus from outputting JS on anything but single posts or pages

Go to source

snippet :  PHPcopy
add_action( 'wp_head', 'tgm_tame_disqus_comments' );
function tgm_tame_disqus_comments() {
	if ( is_singular( array( 'post', 'page' ) ) && comments_open() )
		return;
	remove_action( 'loop_end', 'dsq_loop_end' );
	remove_action( 'wp_footer', 'dsq_output_footer_comment_js' );
}

source →


Stop Disqus from outputting JS on anything but single posts or pages is a post from: wpsnipp.comWordPress Snippets, Code, Hacks, 590+ for your theme, blog
which is not allowed to be copied on other sites.”

Share this post.


Stop Disqus from outputting JS on anything but single posts or pages“>Facebook | Stop Disqus from outputting JS on anything but single posts or pages“>StumbleUpon | Stop Disqus from outputting JS on anything but single posts or pages“>Delicious | Stop Disqus from outputting JS on anything but single posts or pages @wpsnipp”>Tweet It | Stop Disqus from outputting JS on anything but single posts or pages“>Digg This

© wpsnipp.com All Rights reserved.

source: wpsnipp.com