Hello
I want to add Disqus comment via shortcode on specific page, is that possible?
Hello
I want to add Disqus comment via shortcode on specific page, is that possible?
I have the same question.
me too i have same question.
what's shorcode?
I have the same concern...
put this in your functions.php:
function disqus_embed($disqus_shortname) {
global $post;
wp_enqueue_script('disqus_embed','http://'.$disqus_shortname.'.disqus.com/embed.js');
echo '<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = "'.$disqus_shortname.'";
var disqus_title = "'.$post->post_title.'";
var disqus_url = "'.get_permalink($post->ID).'";
var disqus_identifier = "'.$disqus_shortname.'-'.$post->ID.'";
</script>';
}
and then this on the spot where you want to have disqus:
<?php disqus_embed('THE SHORTNAME OF YOUR DISQUS'); ?>
(credits go to this guy : http://ayudawordpress.com/disqus-en-wordpress-sin-necesidad-de-plugin/ I don't speak Spanish :))
thank, it work :)
Hi,
i've added this code to functions.php file in theme folder. I need to put a Disqus comments only on one page (ex. Comments), which use a fullwidth page template, so i must change other pages template to pages with sidebar. And i have an error:
Warning: Cannot modify header information - headers already sent by (output started at /wp-content/themes/volt/functions.php:476) in /wp-includes/pluggable.php on line 876
Line 876 of pluggable.php:
header("Location: $location", true, $status);
}
endif;
Any ideas what's wrong?
You must log in to post.