帝国cms熊掌号号主页展现页面改造教程【快速上手】

  • 1,376 views
  • 阅读模式

任何网站都能实现熊掌号的改造,只要稍微懂得代码,帝国cms号主页展现已经完美实现。让你改造熊掌号【快速上手】本文的代码全部校验通过。
什么是号主页展现

百度熊掌号的官方介绍是资源进入熊掌号主页展现,意思就是让网站发表的文章可以出现在熊掌号【文章】列表中。但并不是所有资源都会出现在该列表上,一般是近期文章,历史资源不会展现,而且一天最多只展现五篇文章。根据博主测试,展现的文章比较随机,而且出图的概率也不是很大。想要实现该功能的站长们需要对网站页面进行改造,可以参考春哥博客改造方法。
下面是改造的代码:一般的都只能展现一张图,这里春哥做了特别处理,我们帝国CMS也可以展示三张图了。符合百度要求的1-3张图。

<link rel="canonical" href="[!--titleurl--]"/>
<script src="//msite.baidu.com/sdk/c.js?appid=你的百度熊掌号ID"></script>

<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "[!--titleurl--]",
"appid": "你的百度熊掌号ID",
"title": "[!--pagetitle--]",
"images": [
<?php
$str=$navinfor['newstext'];
$str = str_replace('http://www.f9seo.com/d/file/','/d/file/',$str);
$str = str_replace('/d/file/','http://www.f9seo.com/d/file/',$str);
preg_match_all('/https:.*?(jpg|gif|png|bmp)/' ,$str, $img);
echo '"'.$img[0][1].'"'.',';
echo '"'.$img[0][2].'"'.',';
echo '"'.$img[0][3].'"';
?>
],
"description": "[!--smalltext--] ",
"pubDate": "<?=date("Y-m-d",$navinfor['newstime'])?>T<?=date("H:i:s",$navinfor['newstime'])?>"
}
</script>

另外值得一提的是号主页展现改造和搜索结果出图改造是一致的,所以做好上面介绍的改造方法可以同时实现这两个功能。

栏目页代码

<link rel="canonical" href="<?=sys_ReturnBqClassUrl($class_r[$GLOBALS[navclassid]]);?>"/>
<script src="//msite.baidu.com/sdk/c.js?appid=<?=$public_r['add_appid']?>"></script>
<script type="application/ld+json"> {
"@context": "https://zhanzhang.baidu.com/contexts/cambrian.jsonld",
"@id": "<?=sys_ReturnBqClassUrl($class_r[$GLOBALS[navclassid]]);?>",
"appid": "<?=$public_r['add_appid']?>",
"title":"<?php $cr=$empire->fetch1("select bname from phome_enewsclass where classid='".$GLOBALS[navclassid]."' limit 1"); echo $cr['bname']; ?>",
"images": [
"[!--class.classimg--]"
],
"description": "[!--pagedes--]",
"pubDate": "<?=date("Y-m-d")?>T<?=date("H:i:s")?>",
"isOriginal": "0"
}</script>

首页调用的代码

<link rel=”canonical” href=”[!–news.url–]”/>
<script src=”//msite.baidu.com/sdk/c.js?appid=<?=$public_r[‘add_appid’]?>”></script>
<script type=”application/ld+json”> {
“@context”: “https://zhanzhang.baidu.com/contexts/cambrian.jsonld”,
“@id”: “[!–news.url–]”,
“appid”: “<?=$public_r[‘add_appid’]?>”,
“title”:”[!–pagetitle–]”,
“images”: [
“http://www.f9seo.comupload/xzh/1.png”,
“http://www.f9seo.comupload/xzh/2.png”,
“http://www.f9seo.comupload/xzh/3.png”
],
“description”: “[!–pagedes–]”,
“pubDate”: “<?=date(“Y-m-d”)?>T<?=date(“H:i:s”)?>”,
“isOriginal”: “0”
}</script>

结语:熊掌号主页展现还是有一定的用处的,平时虎纠自媒体喜欢发表在网站的文章同时发表到百家号,但是发现百家号排名很好,站内网页排名会靠后,所以做了号主页展现的话就没必要把文章发表到百家号,做好熊掌号的同时网站也多了一个流量入口,何乐而不为。

weinxin
虎纠自媒体官方微信
这是我的微信扫一扫
f9seo
  • 本文由 发表于 2018年9月4日23:51:41
  • 转载请务必保留本文链接:https://www.f9seo.com/post-1820.html
评论:2   其中:访客  2   博主  0
    • 任丘网站建设
      任丘网站建设 0

      安装失败 帝国cms 太高冷

    匿名

    发表评论

    匿名网友 填写信息

    :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

    确定