Add the function of the additional emoticon directly to the topic template function.

Source: Internet
Author: User
You are familiar with modifying the default Wordpress emoticon to a custom emoticon. You should have heard of additional emoticon. (You can search for wordpress on this site to find a solution that does not recognize custom emoticon ), I have read about how to add extra emotices on the Internet. In addition to installing the customssmilies plug-in, there is only one left to modify functions in wp-javasdes. This

You are familiar with modifying the default Wordpress emojis to custom emojis, you should have heard of adding additional expressions (you can search for "wordpress's solution to adding a custom expression that is not recognized" on this site). I have read it, in addition to installing the customs smilies plug-in, the method for adding extra emotices on the Internet only involves modifying functions by using wp-javasdes. This

You are familiar with modifying the default Wordpress emojis to custom emojis, you should have heard of adding additional expressions (you can search for "wordpress's solution to adding a custom expression that is not recognized" on this site). I have read it, in addition to installing the customs smilies plug-in, the method for adding extra emotices on the Internet only involves modifying functions with wp-uplodes. This method is of course not good because wordpress is updated, you have to change the function again. Next I will introduce you to the topic functions. add a function in php to add an emoticon. The benefits of doing so are the same as modifying the emoticon image folder.
First, let's look at the principle. (If you don't know the principle, this article is not long enough.) Search for smiley in wp-shortdes → functions. php.smilies_initThis function,

Function smilies_init () {global $ wpsmiliestrans, $ wp_smiliessearch; // don't bother setting up smilies if they are disabledif (! Get_option ('use _ smilies ') return; if (! Isset ($ wpsmiliestrans) {$ wpsmiliestrans = array (': mrgreen:' => 'icon_mrgreen.gif ',': neutral: '=> 'icon_neutral.gif ',//.... one thousand words are omitted here...

From this we can see that the $ wpsmiliestrans array defines the output of the expression,
So next we need to add the following code to the topic's functions. php to redefine the array.

Global $ wpsmiliestrans; $ wpsmiliestrans = array (': new:' => 'new.gif ',': new1: '=> 'new1.gif', ': new2:' => 'new2.gif ', ': new3:' => 'new3.gif ',': new4: '=> 'new4.gif', // and so on ...);

Okay, that's all. I'm not afraid of wordpress updates in the future. My husband is in Tianjin today and will not accompany you in the evening.

Original article address: add the function of the extra emoticon directly in the theme template function. Thank you for sharing it with the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.