wpDiscuz Manually adding comments section to a PHP file

Description

This code will allow you to manually add a comment section into any single.php page wherever you would like. Place the following PHP into the functions.php file and then add the php shortcode into the single.php file

This code will allow you to manually add a comment section into any single.php page wherever you would like. Place the following PHP into the functions.php file and then add the php shortcode into the single.php file

HTML Source Code

                        
                          <?php echo do_shortcode('[wpdiscuz_comments]'); ?>                        
                        

PHP Source Code

                        
                          function my_wpdiscuz_shortcode() {
   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';
   }
}
add_shortcode( 'wpdiscuz_comments', 'my_wpdiscuz_shortcode' );                        
                        


Post Categories