How to display Disqus comment count in WordPress?

Integrating Disqus Into WordPress Without a Plugin As we discussed earlier, doing stuff without plugins helps us optimize our website – a single query is a single query, right? Anyways, here are the functions that we’re going to use – like always, add these inside your theme’s functions.php file: Embedding Disqus Comments function disqus_embed($disqus_shortname) { … Read more

How to not load comments form on post preview?

I took a quick peek at the disqus plugin. This works in disabling the option before the plugin decides to print out the form. add_filter( ‘pre_option_disqus_active’, ‘wpse_conditional_disqus_load’ ); function wpse_conditional_disqus_load( $disqus_active ) { if( is_preview() ){ return ‘0’; } return $disqus_active; } You could also try something like this (not tested) add_filter( ‘the_content’, ‘wpse_load_disqus’); function … Read more

How to change style of Disqus comment count on main page

The comment count in your theme is wrapped in <span class=”comments-link”>…</span>, so you can set a CSS rule in your CSS file like: .comments-link { //here your rules } For future questions, please, note that questions about pure CSS, not specific to WordPress, can be more suitable for other sites, may stackoverflow.

Tracking Disqus comments on Google Analytics

You can use that snippet just anywhere where it can be rendered on single pages. For example, you can paste this under functions.php of your theme: function hook_disqus_config(){ if( ! is_singular() ) return; ?> <script type=”text/javascript”> function disqus_config() { this.callbacks.onNewComment = [function(comment) { _gaq.push([‘_trackEvent’, ‘Disqus’, ‘New Comment’, comment.id]); }]; } </script> <?php } add_action( ‘wp_footer’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)