![子比主题添加文章评论常用语功能[子比教程]插图 子比主题添加文章评论常用语功能[子比教程]插图](https://zy.nuoyo.cn/wp-content/uploads/2023/12/20231215181636173-6c9b6cac57a8d858f51e9814af1e556f.webp)
前言
为了方便大家评论文章,懒得自己写评论,站长也不想你们随意写评论,所以花亿点点时间写文章评论常用词组的功能,哈哈哈~~~
教程
CSS代码样式
在后台主题设置[自定义CSS样式]添加下面CSS代码:
/*常-用-语样式*/.wiiuii-words-li{margin:5px auto;padding:5px;background:var(--body-bg-color);border-radius:var(--main-radius)}.wiiuii-words-li:hover{background:var(--float-btn-bg)}/*常-用-语样式*/ .wiiuii-words-li{margin:5px auto;padding:5px;background:var(--body-bg-color);border-radius:var(--main-radius)} .wiiuii-words-li:hover{background:var(--float-btn-bg)}/*常-用-语样式*/ .wiiuii-words-li{margin:5px auto;padding:5px;background:var(--body-bg-color);border-radius:var(--main-radius)} .wiiuii-words-li:hover{background:var(--float-btn-bg)}
JS代码样式
在后台主题设置[自定义javascript代码]添加下面jQuery代码:
// 评-论-常-用-语JS$('.wiiuii-words-li').on('click', function() {var $wiiuii_comment = $('#comment');var wiiuii_com_text = $(this).find('span').text();var wiiuii_com_original = $wiiuii_comment.val();$wiiuii_comment.val(wiiuii_com_original ? wiiuii_com_original + ' ' + wiiuii_com_text : wiiuii_com_text);$('.wiui_words').removeClass('open');});// 评-论-常-用-语JS $('.wiiuii-words-li').on('click', function() { var $wiiuii_comment = $('#comment'); var wiiuii_com_text = $(this).find('span').text(); var wiiuii_com_original = $wiiuii_comment.val(); $wiiuii_comment.val(wiiuii_com_original ? wiiuii_com_original + ' ' + wiiuii_com_text : wiiuii_com_text); $('.wiui_words').removeClass('open'); });// 评-论-常-用-语JS $('.wiiuii-words-li').on('click', function() { var $wiiuii_comment = $('#comment'); var wiiuii_com_text = $(this).find('span').text(); var wiiuii_com_original = $wiiuii_comment.val(); $wiiuii_comment.val(wiiuii_com_original ? wiiuii_com_original + ' ' + wiiuii_com_text : wiiuii_com_text); $('.wiui_words').removeClass('open'); });
第一步:在“../zibll/template/comments.php”子比主题的template目录下“comments.php”文件合适位置添加下面代码:【看截图】
// 常-用-语函数if (_pz('comment_words', true)) {echo zib_get_input_expand_but('wiui_words');}// 常-用-语函数 if (_pz('comment_words', true)) { echo zib_get_input_expand_but('wiui_words'); }// 常-用-语函数 if (_pz('comment_words', true)) { echo zib_get_input_expand_but('wiui_words'); }
![子比主题添加文章评论常用语功能[子比教程]插图1 子比主题添加文章评论常用语功能[子比教程]插图1](https://zy.nuoyo.cn/wp-content/uploads/2023/12/20231215181552419-89e88f9ab3136da885af2215b6243b72.webp)
第二步:在“../zibll/inc/functions/functions.php”子比主题的template目录下“functions.php”文件合适位置添加下面代码:【看截图】
![子比主题添加文章评论常用语功能[子比教程]插图2 子比主题添加文章评论常用语功能[子比教程]插图2](https://zy.nuoyo.cn/wp-content/uploads/2023/12/20231215181627209-e7e0892d4f2acdbbbd8ca76d6388400a.webp)
暂无评论内容