織夢模板文章內(nèi)容頁SEO優(yōu)化代碼
織夢模板文章內(nèi)容頁SEO優(yōu)化代碼,效果如下:
頭部代碼:
<meta property="og:type" content="article"/>
<meta property="og:image" content="{dede:field.body runphp=yes}preg_match_all("/<img([^>
]*)\s*src=('|\")([^'\"]+)('|\")/",@me,$matches);$imgsrc_arr = array_unique($matches[3]);@me = $imgsrc_arr[0];{/dede:field.body}"/>
<meta property="article:published_time" content="{dede:field.pubdate function='strftime("%Y-%m-%dT%H:%M:%S",@me)'/}"/>
<meta property="og:author" content="{dede:field.writer/}"/>
<meta property="og:source" content="{dede:field.source/}"/>
<meta property="og:title" content="{dede:field.title/}"/>
<meta property="article:tag" content="{dede:tag row='30' sort='new' getall='0'}[field:tag /],{/dede:tag}">
<meta property="og:description" content="{dede:field name='description' function='html2text(@me)'/}"/>
<meta property="og:category" content="{dede:field.typename/}"/>
<meta property="og:latest_chapter_url" content="{dede:field.arcurl/}"/>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{dede:field.title/}-{dede:global.cfg_webname/}">
<meta name="twitter:description" content="{dede:field.description/}">
<meta name="twitter:image" content="{dede:field.litpic/}">
注意,關(guān)于圖片,第一個我用的是原圖,第二個是縮略圖,所以調(diào)用的圖片不一樣。
聲明:
1.本站主要是為了記錄工作、學(xué)習(xí)中遇到的問題,可能由于本人技術(shù)有限,內(nèi)容難免有紕漏,一切內(nèi)容僅供參考。
2.本站部分內(nèi)容來源互聯(lián)網(wǎng),如果有圖片或者內(nèi)容侵犯您的權(quán)益請聯(lián)系我們刪除!
3.本站所有原創(chuàng)作品,包括文字、資料、圖片、網(wǎng)頁格式,轉(zhuǎn)載時請標(biāo)注作者與來源。
1.本站主要是為了記錄工作、學(xué)習(xí)中遇到的問題,可能由于本人技術(shù)有限,內(nèi)容難免有紕漏,一切內(nèi)容僅供參考。
2.本站部分內(nèi)容來源互聯(lián)網(wǎng),如果有圖片或者內(nèi)容侵犯您的權(quán)益請聯(lián)系我們刪除!
3.本站所有原創(chuàng)作品,包括文字、資料、圖片、網(wǎng)頁格式,轉(zhuǎn)載時請標(biāo)注作者與來源。
THE END