WordPress原生函数comment_form()评论表情插入的方法
上次写过一篇文章:
WordPress评论表情,大家都不陌生,如果评论页面comment.php有comment表单,就用上面的方法:
很多博客主题是没有comment表单的,上面的方法就没有效果,那MK就来推荐下面的方法:
这种方法写的评论表情插入代码是很方便的,就一个 smiley.php 文件,但现在用 原生comment_form() 生成表单应该怎样插入调用代码呢?
一、改造 smiley.php
改造后的代码如下:
< ?php $smilies = '![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
' ?>
二、调用
打开你目前使用主题的comments.php文件,在相应的位置加入以下代码:
< ?php include(TEMPLATEPATH . '/includes/smiley.php'); ?>
三、自定义表情路径
将下面的代码加入主题的functions.php文件(具体怎么加你懂的啦)
//自定义表情路径
function custom_smilies_src($src, $img){return get_bloginfo('template_directory').'/images/smilies/' . $img;}
add_filter('smilies_src', 'custom_smilies_src', 10, 2);
四、效果
WordPress自定义调用评论表情的方法 JS数据类型转换详解

Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.