• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    dedecms织梦制作xml网站地图的方法
    POST TIME:2021-05-23 01:26

    在一个网站中网站地图是不能少的,有网站地图不仅可以提升网站浏览者的用户体验,还可以让蜘蛛更好的抓取网站,让网站有一个更好的收录和排名。
    织梦制作xml网站地图的方法步骤:

    第一步:分别打开/dede/inc/inc_menu.php和/dede/inc/inc_menu_map.php文件

    找到 <m:item name='更新主页HTML' link='makehtml_homepage.php' rank='sys_MakeHtml' target='main' />
    修改为:
    <m:item name='更新Sitemap' link='makehtml_sitemap.php' rank='sys_MakeHtml' target='main' />

    第二步:制作dede/makehtml_sitemap.php文件

    拷贝一个dede/makehtml_homepage.php文件
    找到$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($homeFile);
    这段代码直接删除,底部修改调用生成文件模板为makehtml_sitemap.htm,然后另存为makehtml_sitemap.php,上传至dede/即可。

    第三步:制作后台更新模板文件dede/templets/makehtml_sitemap.htm

    拷贝一个dede/templets/makehtml_homepage.htm文件
    找到
    <input name="templet" type="text" id="templet" style="width:300″ value="<?php echo $row['templet']?>">
    修改为:
    <input name="templet" type="text" id="templet" style="width:300″ value="default/sitemap.xml">
    找到
    <td height="20″ valign="top" bgcolor="#FFFFFF"><input name="position" type="text" id="position" value="<?php echo $row['position']?>" size="30″>
    修改为:
    <td height="20″ valign="top" bgcolor="#FFFFFF"><input name="position" type="text" id="position" value="../sitemap.xml" size="30″>
    然后另存为makehtml_sitemap.htm,上传至dede/templets/;

    第四步:制作sitemap模板文件,即templets/sitemap.xml

    将一下代码保存为sitemap.xml即可
    <?xml version="1.0" encoding="gb2312"?>
    <?xml-stylesheet type="text/xsl" href="/templets/css/sitemap.xsl"?><!-- generator="dedecms/3.2" -->
    <urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
    <url>
    <loc>http://www.织梦58dede58.comm</loc>
    <lastmod>
    {dede:arclist row=1 titlelen=30 orderby=pubdate}
    [field:pubdate function=strftime('%Y-%m-%d',@me)/]
    {/dede:arclist}
    </lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
    </url>
    {dede:channel row='30' type='top'}
    <url>
    <loc>[field:typelink /]</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
    </url>
    {/dede:channel}
    {dede:arclist row=2000 orderby=pubdate}
    <url>
    <loc>[field:arcurl/]</loc>
    <lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod>
    <changefreq>monthly</changefreq>
    </url>
    {/dede:arclist}
    </urlset>

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!