织梦dedecms制作谷歌地图的方法


织梦dedecms在默认程序中就自带了百度地图,所以在生成的时候就容易多了,但是在谷歌地图上就没有那么简单了,网站地图对优化也有很大的好处,所以在网站中最好两个地图都存在,这样才能让网站有一个更好的排名。

复制下面的这些代码保存为sitemap.htm模板文件然后上传到模板所在目录templets/{style}/sitemap.htm 这样的路径,其中{style}为模板文件夹

<?xml version=”1.0″ encoding=”UTF-8″?>

<urlset xmlns=”http://www.织梦58dede58.com/schemas/sitemap/0.9″>

  <url>

    <loc>http://你的域名</loc>

    <lastmod>{dede:arclist row=1 titlelen=24 orderby=pubdate}

    [field:pubdate function=strftime(‘%Y-%m-%d’,@me)/]

    {/dede:arclist}</lastmod>

    <changefreq>daily</changefreq>

    <priority>1.0</priority>

  </url>

  {dede:channel row=’100′ type=’top’}

  <url>

    <loc>http://你的域名[field:typelink /]</loc>

    <changefreq>daily</changefreq>

    <priority>0.8</priority>

  </url>

  {/dede:channel}

  {dede:arclist row=10000 orderby=pubdate}

  <url>

    <loc>http://你的域名[field:arcurl/]</loc>

    <lastmod>[field:pubdate function=strftime(‘%Y-%m-%d’,@me)/]</lastmod>

    <changefreq>monthly</changefreq>

  </url>

  {/dede:arclist}

</urlset>