Skip to content

Instantly share code, notes, and snippets.

@PabloVallejo
Created February 21, 2013 15:05
Show Gist options
  • Save PabloVallejo/5005286 to your computer and use it in GitHub Desktop.
Save PabloVallejo/5005286 to your computer and use it in GitHub Desktop.
<?php
/**
* Embed Disqus in Static template
* Taken from http://wp.tutsplus.com/tutorials/plugins/integrating-disqus-into-wordpress/
*
* @param { string } disqus shortname
*/
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>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment