欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

WordPress

當前位置:主頁 > CMS教程 > WordPress >

wordpress非插件實現(xiàn)xml格式網(wǎng)站地圖

來源:本站原創(chuàng)|時間:2020-01-11|欄目:WordPress|點擊: 次

廢話不多說,直接上代碼

復制代碼
代碼如下:

<?php
require('./wp-blog-header.php');
header("Content-type: text/xml");
header('HTTP/1.1 200 OK');
$posts_to_show = 1000; // 獲取文章數(shù)量
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<urlset xmlns:xsi="<a rel="external nofollow" >http://www.w3.org/2001/XMLSchema-instance</a>" xmlns="<a rel="external nofollow" rel="external nofollow" >http://www.sitemaps.org/schemas/sitemap/0.9</a>"
xsi:schemaLocation="<a rel="external nofollow" rel="external nofollow" >http://www.sitemaps.org/schemas/sitemap/0.9</a> <a rel="external nofollow" >http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'</a>;
?>
<!-- generated-on=<?php echo get_lastpostdate('blog'); ?>-->
<url>
<loc>http://localhost/</loc>
<lastmod><?php echo get_lastpostdate('blog'); ?></lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<?php
header("Content-type: text/xml");
$myposts = get_posts( "numberposts=" . $posts_to_show );
foreach( $myposts as $post ) { ?>
<url>
<loc><?php the_permalink(); ?></loc>
<lastmod><?php the_time('c') ?></lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<?php } // end foreach ?>
</urlset>

復制上面代碼為xmlmap.php文件并傳至網(wǎng)站根目錄
http://localhost/xmlmap.php

上一篇:WordPress修改新用戶注冊郵件內(nèi)容的方法

欄    目:WordPress

下一篇:WordPress實現(xiàn)網(wǎng)站投稿者也可以上傳圖片的方法

本文標題:wordpress非插件實現(xiàn)xml格式網(wǎng)站地圖

本文地址:http://mengdiqiu.com.cn/a1/WordPress/12742.html

網(wǎng)頁制作CMS教程網(wǎng)絡編程軟件編程腳本語言數(shù)據(jù)庫服務器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有