Home>Article>CMS Tutorial> How to replace comment emoticons on wordpress website
The first method
is to use the same emoticon name and replace it with the image in the emoticon column of the WordPress site, wp-includes\images\ smilies
Put the modified name and suffix of the emoticon into wp-includes\images\smilies
Related recommendations: "WordPress Tutorial"
Just return to the website and refresh to see the replacement effect. This method has a disadvantage, that is, the emoticon will be replaced again when the WordPress website is upgraded.
The second method
Put the emoticon package you prepared into the theme images\smilies. If you don’t have yourself Create a new
# and put the following code in front of the last line of functions.php in the theme directory. Here aa is a custom name. I only wrote 2 expression tags. You can write as many expressions as you have. Also pay attention to the theme author's prompts, if there are none, please ignore them.
//自定义表情路径和名称 function custom_smilies_src($src, $img){return get_bloginfo('template_directory').'/images/smilies/' . $img;} add_filter('smilies_src', 'custom_smilies_src', 10, 2); if ( !isset( $wpsmiliestrans ) ) { $wpsmiliestrans = array( ':aa:' => 'aa.gif', ':bb:' => 'bb.gif', ); }
Modify the a tag in the smiley.php file in the theme directory and replace the tag and picture of your own expression. Write as many expressions as you like. This method is permanent.
The above is the detailed content of How to replace comment emoticons on wordpress website. For more information, please follow other related articles on the PHP Chinese website!