在後臺設定 SEO 後,更新快取了,門戶首頁的關鍵詞和描述仍然顯示 「首頁」 很鬱悶,在網上找了一些資料後,發現需要修改頂部的模板程式碼,
首先進入 DZ 後臺-然後,全域性-seo 設定--門戶-設定好標題,關鍵詞,描述後如果還是檢測不到關鍵詞,就按以下方法:
FTP 下載模板檔案:template/default/common/header_common.htm
找到以下程式碼:
本帖隱藏的內容
<meta name="keywords" content="{if !empty($$metakeywords)}{echo dhtmlspecialchars($$metakeywords)}{/if}" />
<meta name="description" content="{if !empty($$metadescription)}{echo dhtmlspecialchars($$metadescription)} {/if}{if empty($$nobbname)},$$_G['setting']['bbname']{/if}" />
替換為:
<meta name="keywords" content="{if ''==strstr( $$_G['setting']['seokeywords']['portal'])} $_G['setting']['seokeywords']['portal'] {/if}" />
<meta name="description" content="{if ''==strstr($$_G['setting']['seodescription']['portal'])} $_G['setting']['seodescription']['portal'] {/if}/>
儲存後覆蓋上傳,覆蓋之前記得先備份一下哦。
覆蓋完成後,進入後臺更新快取,然後重新整理門戶首頁,就可以看到和你後臺設定的一樣了。