search
HomeCMS TutorialWordPressHow to replace comment emoticons on wordpress website

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

How to replace comment emoticons on wordpress website

Put the modified name and suffix of the emoticon into wp-includes\images\smilies

How to replace comment emoticons on wordpress website

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.

How to replace comment emoticons on wordpress website

The second method

Put the emoticon package you prepared into the theme images\smilies. If you don’t have yourself Create a new

How to replace comment emoticons on wordpress website

# 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',
        );
    }

How to replace comment emoticons on wordpress website

How to replace comment emoticons on wordpress website

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.

How to replace comment emoticons on wordpress websiteHow to replace comment emoticons on wordpress website

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The 5 Best IDEs for WordPress Development (And Why)The 5 Best IDEs for WordPress Development (And Why)Mar 03, 2025 am 10:53 AM

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

Create WordPress Plugins With OOP TechniquesCreate WordPress Plugins With OOP TechniquesMar 06, 2025 am 10:30 AM

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

How to Pass PHP Data and Strings to JavaScript in WordPressHow to Pass PHP Data and Strings to JavaScript in WordPressMar 07, 2025 am 09:28 AM

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

How to Embed and Protect PDF Files With a WordPress PluginHow to Embed and Protect PDF Files With a WordPress PluginMar 09, 2025 am 11:08 AM

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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

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

Atom editor mac version download

The most popular open source editor