wordpress建站过程中,中文站点里当我们开启固定链接并且使用文章的标题作为链接时,链接经常会变得非常长,看起来很不美观,而且对收录也不是太友好。这时候我们可以采用百度翻译的翻译API,将中文的文章标题自动翻译为英文。
使用方法如下,切换到主题目录,打开functions.PHP文件,加入以下代码:
Crayon-5c891d3f50fe6733644359" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">
Crayon-nums " data-settings="show"> Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"> Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-1">1 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-3">3 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-5">5 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-7">7 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-9">9 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-11">11 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-13">13 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-15">15 Crayon-num" data-line="Crayon-5c891d3f50fe6733644359-17">17 | Crayon-code">