Publish: 2017-06-22 | Modify: 2017-06-22
If your WordPress blog does not support Ajax comments, please continue reading. The advantage of Ajax comments is that you can submit comments without refreshing the entire page. This method is suitable for WordPress >= 4.4. If your WordPress version is lower than this, please upgrade first.
functions.php
file in your theme directory and add the following code to load the Ajax comment:require('ajax-comment/main.php');
That's it! However, the comment style may not be fully compatible with your theme. You can modify the app.js
file in the code package, around line 4, to customize the CSS style:
__list = 'comment-list';
Before making any code modifications, please make sure to backup your files to avoid any errors that may cause your website to be inaccessible.
This article is referenced from: WordPress Ajax 评论提交
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.