How to make wordpress theme support threaded comment?

comments template is the most difficult part in building a theme. When it comes to make a threaded comments supported wordpress theme, comments template becomes more complex. However, there are many users like threaded comment as it show a clear relationship between each comments.

There is a simple idea: copy the build-in template if you are using a wordpress edition 2.7 or later. This methods may makes your template code not so harmonious with other parts. But if you don’t want to waste too much money on this part, you can use this method by just use the build-in function “wp_list_comments()” to display comments.

But I want to customize codes. Here is my solution to build a threaded comments supported wordpress theme.

Define customized comments codes in your wordpress theme file Function.php. Then put this code into your comments.php file: wp_list_comments(‘callback=custom_comments’)

In the function.php file, I just added codes as follows:

  $depth, 'max_depth' => $args['max_depth']))) ? >

The last step to show threaded comments is to turn on threaded comments support in “Discussion” tab in worpdress admin panel.

Based on many years of experience, Panerai Radiomir have now become a top level brand watch. They are prepared to offer you the finest condition watches. It will makes you stand out among your friends.

一条评论 留下评论

留下评论







注意: 第一次留言的用户,您的评论需要审核通过才会显示,抱歉!