在栏目--》自定义页面中输入xml标题,然后生成的url填写 sitemap.xml,代码如下:
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>[!--news.url--]</loc>
<priority>1.000</priority>
</url>
[e:loop={"select * from [!db.pre!]ecms_news order by id desc",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
<changefreq>daily</changefreq>
<priority>0.7000</priority>
</url>
[/e:loop]
</urlset>
解释说明:
1、[!--news.url--] 网站系统参数设置,网站地址填写的url
2、<?=$bqsr[titleurl]?> 调用所有的文章的url
3、<?=date('Y-m-d',$bqr[newstime])?> 调用文章发布的时间日期,年月日的展示效果
下一篇:谷歌SEO优化8大步骤