i want deregister script count.js of disqus comment system plugin in wordpress. script in location:
/wp-content/plugins/disqus-comment-system/media/js/count.js?ver=4.2.2
i try many different way, nothing. this:
function prefix_my_scripts() { wp_deregister_script('count'); /* tried 'dsq_count_script' */ } add_action('wp_enqueue_scripts', 'prefix_my_scripts'); and also:
function prefix_my_scripts() { wp_dequeue_script('count'); /* tried 'dsq_count_script' */ } add_action('wp_enqueue_scripts', 'prefix_my_scripts'); i have seen plugin generate script in way:
wp_register_script( 'dsq_count_script', plugins_url( '/media/js/count.js', __file__ ) ); wp_localize_script( 'dsq_count_script', 'countvars', $count_vars ); wp_enqueue_script( 'dsq_count_script', plugins_url( '/media/js/count.js', __file__ ) ); after deregister want add script inline before close of body tag.
how can that?
the script added by:
add_action('wp_footer', 'dsq_output_footer_comment_js'); so should remove by:
remove_action( 'wp_footer', 'dsq_output_footer_comment_js' ); you can paste code in (child) theme's functions.php.
Comments
Post a Comment