Sanitize Disqus API results?
Assuming you’re talking about the body of a comment, there’s nothing to worry about. We already sanitize comment and thread messages.
Assuming you’re talking about the body of a comment, there’s nothing to worry about. We already sanitize comment and thread messages.
oh, it looks like I wrote that script, so let me try to answer you 😉 You could for example: add your own action hook in your template, use javascript to move the pings below the Disqus comments, hijack the disqus_language_filter filter of the Disqus plugin. If you go for the last option, you could … Read more
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
I’ve personally stayed away from any external or 3rd party system. Many times commenters are apprehensive about using “another” account or service, esp with recent privacy issues with Facebook, etc. Also, many add bloat and delay page load to run their own scripts, etc and can be harder to style to fit within an existing … Read more
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
Are you registering your CPT with comments in supports array of register_post_type()? From brief look at Disqus plugin code there is dsq_comments_template() function that checks for related stuff and it likely returns false if support for comments is not declared.
I had to get some band reviews that were already in Disqus from my old site into my new WordPress band site. I only wanted the reviews on our home page so here’s what I did… I looked at the code on my old site and grabbed the disqus_identifier value from there. I defined and … Read more
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.
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
Goto Dashboard > Pages . Click on ‘Edit’ for the page you want to hide comments on. On the top of this screen you’ll get Screen Options, Expand this section. Check/Enable the Discussion button. Scroll down on the screen. Uncheck the Allow Comments option.