How to add contact information in wordpress
In the WordPress backend, in the personal settings (Profile), in addition to setting the email In addition to email and website, you can also set up your own contact information, such as AIM, Yahoo IM, Jabber/Google Talk. But except for Gtalk, the other two are basically not used by Chinese people. So how do we remove AIM and Yahoo IM, which we basically don’t use, and add QQ, MSN and Fetion, which are commonly used by Chinese people?
In fact, it is very easy to implement such a function in WordPress. You only need to call the custom_contactmethods WordPress Filter to support commonly used contact methods such as QQ, MSN and Fetion in the background. The code is as follows:
<?php /* Plugin Name: Custom Contact Plugin URI: http://wpjam.com/ Description: 自定义博客的联系方式,从 WordPress 默认的 AIM, Yahoo IM 改为中国常见的 QQ, MSN 和飞信。 Version: 1.0 Author: Neekey Author URI: http://photozero.net/ */ add_filter('user_contactmethods','custom_contactmethods'); function custom_contactmethods($user_contactmethods ){ $user_contactmethods = array( 'qq' => 'QQ', 'msn' => 'MSN', 'jabber' => __('Jabber / Google Talk'), 'fetion' => '飞信' ); return $user_contactmethods ; } ?>
Save the above code as a PHP file in UTF-8 without BOM format, upload it to the WordPress plug-in directory, and then activate it. If you need to add other contact information, you only need to add it in the above array in the same way. I will not introduce them in detail here.
Before using the plug-in:
The effect after using the plug-in:
This function is in a It is particularly useful in multi-user managed blogs. We will apply this function in the next project, please stay tuned.
For more WordPress technical articles, please visit the WordPress Tutorial column!
The above is the detailed content of How to add contact information in wordpress. For more information, please follow other related articles on the PHP Chinese website!