這幾天對google的數(shù)據(jù)優(yōu)化,在show.html中head
<!-- 結(jié)構(gòu)化數(shù)據(jù)標記。 -->
<script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "Article",
"headline": "正常",
"datePublished": 空
"image": "空",
"articleBody": "正常"
"author":空
}
</script>
源碼:
<script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "Article", //文章模式
"headline": "{$meta_keywords}",//標題
"datePublished": {dr_date($t['_inputtime'], 'Y-m-d')},//時間
"image": "{dr_get_file($t['thumb'])}",//文章第一張圖
"articleBody": "{$meta_description}"//內(nèi)容簡介
"author": {$t['author']}//作者
}
</script>
show.html頁面不應(yīng)該加前綴$t
內(nèi)容頁的模板標簽生成工具:http://www.apdwn.com/doc/code/show.html
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
參考文檔:《提取html中的圖片》 多找一下手冊
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
支持,學習,加油!
<!-- 結(jié)構(gòu)化數(shù)據(jù)標記。 -->
<script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "Article",
"headline": "{$meta_keywords}",
"datePublished": {dr_date($_inputtime, 'Y-m-d')} ,
"image": "{php $imgs = dr_get_content_img($content, 1);}<img src="{$imgs[0]}">",
"articleBody": "{$meta_description}"
"author": {$author}
}
</script>