shortcodes-disqus.php 618 Bytes
<?php
add_shortcode('disqus-thread', 'disqus_thread');


function disqus_thread(){
  ob_start();
  if ( comments_open() || get_comments_number() ) {
    comments_template();
    }
    if(file_exists(ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php')){
        include_once ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php';
    }

 wp_reset_query();
 $output = ob_get_clean(); 
 return $output;
 }

 function comment_support_for_my_custom_post_type() {
    add_post_type_support( 'page', 'comments' );
}
add_action( 'init', 'comment_support_for_my_custom_post_type' );