织梦dedecms网站怎么进行熊掌号改造呢?今天润壤网络就给大家说下织梦cms制作的网站,熊掌号改造的方法。
第一步:添加熊掌号ID声明
在页面</head>标签前添加代码 <script src="//msite.baidu.com/sdk/c.js?appid=你的ID"></script>
第二步:添加canonical标签
//自动获取织梦当前页链接 <link rel="canonical" href="{dede:global.cfg_basehost/}{dede:field name='arcurl'/}"/> //这里冬镜特别提醒:必须写变量,不要去写固定链接
要求href的内容为MIP页或H5页对应的PC页地址;如果没有PC端页,则填写当前移动端页面地址,位置在<head>标签内。
第三步:添加JSON_LD数据
<script type="application/ld+json"> { "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld", "@id": "{dede:global.cfg_basehost/}{dede:field name='arcurl'/}", "appid": "你的ID", "title": "{dede:field.title/}", "images": [ "{dede:field.litpic /}" //获取文章第一张图片 ], "description": "{dede:field.description function='html2text(@me)'/}", "pubDate": "{dede:field.pubdate function="MyDate('Y-m-dTH:i:s',@me)"/}" } </script>
热点文章
最新文章