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!

Choosing the Right Integrated Development Environment (IDE) for WordPress Development For ten years, I've explored numerous Integrated Development Environments (IDEs) for WordPress development. The sheer variety—from free to commercial, basic to fea

This tutorial demonstrates building a WordPress plugin using object-oriented programming (OOP) principles, leveraging the Dribbble API. Let's refine the text for clarity and conciseness while preserving the original meaning and structure. Object-Ori

Best Practices for Passing PHP Data to JavaScript: A Comparison of wp_localize_script and wp_add_inline_script Storing data within static strings in your PHP files is a recommended practice. If this data is needed in your JavaScript code, incorporat

This guide demonstrates how to embed and protect PDF files within WordPress posts and pages using a WordPress PDF plugin. PDFs offer a user-friendly, universally accessible format for various content, from catalogs to presentations. This method ens


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download
The most popular open source editor
