1、修改??? 網站根目錄/wp-includes/functions.php中smilies_init() 的定義。下面是我修改后的smilies_init()中if ( !isset( $wpsmiliestrans ) )部分。
‘:(1):’ => ‘xiaone_1′,
‘:(2):’ => ‘xiaonei_2′,
‘:(3):’ => ‘xiaonei_3′,
‘:(4):’ => ‘xiaonei_4′,
‘:(5):’ => ‘xiaonei_5′,
‘:(6):’ => ‘xiaonei_6′,
‘:(7):’ => ‘xiaonei_7′,
‘:(8):’ => ‘xiaonei_8′,
‘:(9):’ => ‘xiaonei_9′,
‘:(10):’ => ‘xiaonei_10′,
‘:(11):’ => ‘xiaonei_11′,
‘:(12):’ => ‘xiaonei_12′,
‘:(13):’ => ‘xiaonei_13′,
‘:(14):’ => ‘xiaonei_14′,
‘:(15):’ => ‘xiaonei_15′,
‘:(16):’ => ‘xiaonei_16′,
‘:(17):’ => ‘xiaonei_17′,
‘:(18):’ => ‘xiaonei_18′,
‘:(19):’ => ‘xiaonei_19′,
‘:(20):’ => ‘xiaonei_20′,
‘:(21):’ => ‘xiaonei_21′,
‘:(22):’ => ‘xiaonei_22′,
‘:(23):’ => ‘xiaonei_23′,
‘:(24):’ => ‘xiaonei_24′,
);
}
2、修改????? 網站根目錄/wp-includes/formatting.php 中? function translate_smiley($smiley) 的定義。下面是我修改后的function translate_smiley($smiley) 的代碼段。
function translate_smiley($smiley) {
global $wpsmiliestrans;
if (count($smiley) == 0) {
return ”;
}
$siteurl = get_option( ’siteurl’ );
$smiley = trim(reset($smiley));
$img = $wpsmiliestrans[$smiley];
$smiley_masked = esc_attr($smiley);
return ” <a class=’wp-smiley $img’ ></a> “;
}
3、在評論文本框附近的表情顯示(就是你能看到的點擊一個表情就會在文本框輸入對應的符號),由于我沒有用WP表情插件,用的是老萬他們用的smiley.php這個文件,所以接下來做的就是修改smiley.php了(由于這里貼代碼沒有太大意義,所以在文章最后所有修改后的文件一并給出)
4、設計CSS樣式。(代碼略)
主題貓WP建站,累計幫助1300+客戶成功建站,為站長提供支持!
立刻開啟你的建站之旅