我試過了,都很有效
/% BA % BC % D6 % DD % C0 % EE % CF % E9/blog/item/a 42 DCC 2606 c 0 CCE 199250 af 2 . html
1.在妳安裝的網站根目錄wp content/themes中的主題目錄下找到header.php文件,通常在後臺。找到下面的代碼
meta http-equiv = " Content-Type " Content = " text/html;charset=UTF-8" /
在下面添加下面的調用代碼。
& lt?php if (is_home()) {?& gt
& ltMeta name="keywords" content= "您網站的關鍵字"/& gt;
& ltmeta name = " description " content = " description of your website "/& gt。
& ltlink rel = " canonical " href = " & lt?PHP echo get _ settings(' home ');?>/& gt;
& lt?php }?& gt
& lt?php if ( is_single() ) {?& gt
& ltmeta name = " keywords " content = " & lt;?php $ key = " keywordsecho get _ post _ meta($ post-& gt;ID,$key,true);?>/& gt;
& ltmeta name= "描述" content = " & lt?php $ key = " descriptionecho get _ post _ meta($ post-& gt;ID,$key,true);?>/& gt;
& ltlink rel = " canonical " href = " & lt?PHP echo get _ permalink($ post-& gt;ID);?>/& gt;
& lt?php }?& gt
2.修改:妳網站的關鍵詞就是妳首頁想要的關鍵詞,妳網站的描述就是妳網站的描述。確定主頁的關鍵字和描述。
用於文章頁面。需要調用自定義列,打開後臺頁面右上角的顯示選項(正常情況下是壓縮的)。勾選自定義欄。
添加兩個自定義列(因為上面的代碼已經被註釋了。如果是文章頁面,調用自定義字段中的關鍵字和描述:
名稱壹:關鍵詞價值壹:妳需要的頁面關鍵詞。
名稱二:descroption值二:需要的頁面描述。