网站地图对于一个站点的重要性,网站设置百度sitemap.xml,能够帮助我们网站收录,让搜索引擎更加的了解你的网站(同时要注意对文件里权重的设置),下面就讲下在帝国CMS里面怎么设置网站地图sitemap.xml。
首页打开帝国后台,栏目—自定义页面-增加自定义页面

选择:直接页面式 设置页面名称为sitemap.xml ,修改文件名为:../../sitemap.xml (根目录) 页面内容填写下面代码:

<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>[!--news.url--]</loc>
<lastmod> <?php echo date("Y-m-d"); ?></lastmod>
<changefreq>daily</changefreq>
<priority>1.000</priority>
</url>
[e:loop={"select * from [!db.pre!]enewsclass order by myorder",0,24,0}]
<?
if($bqr['classurl']=='')
{
$sccurl=$public_r['newsurl'].$bqr['classpath']."/";
}
else
{
$sccurl=$bqr['classurl']."/";
}
?>
<url>
<loc><?=$sccurl?></loc>
<changefreq>daily</changefreq>
<priority>0.8000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]enewszt order by ztid",0,24,0}]
<?
if($bqr['zturl']=='')
{
$sccurl=$public_r['newsurl'].$bqr['ztpath']."/";
}
else
{
$sccurl=$bqr['zturl']."/";
}
?>
<url>
<loc><?=$sccurl?></loc>
<lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
<changefreq>monthly</changefreq>
<priority>0.6000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_news order by newstime desc",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
<changefreq>monthly</changefreq>
<priority>0.5000</priority>
</url>
[/e:loop]
</urlset>
设置好后保存:刷新自定义页面

好了,帝国cms仿站之网站地图制作完成。
声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益
请联系邮箱:312334557@qq.com 我们将配合处理!
原文地址:《帝国cms网站地图sitemap.xml的制作方法(帝国cms标签模板)》发布于2022-10-08 14:19:11