Customise Comments

Enable Threaded Comments in WordPress

Threaded comments is a nice feature to highlight to your visitors the admin comments or reply comments this enables better readability of the comments section of your blog posts.

There are plugins which allow you to enable threaded comments but this can easily be done by using a wordpress hook.

Just add the below snippet into your functions.php.

// enable threaded comments
function enable_threaded_comments(){
if (!is_admin()) {
     if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
          wp_enqueue_script('comment-reply');
     }
}

add_action('get_header', 'enable_threaded_comments');
Back to top

Gain access to all tutorials

  • Premium tutorials covering WordPress, Laravel and VueJS
  • Download premium content
  • Download premium WordPress plugins
  • Only $5 a month

Join Paulund