wordpress网站地图Sitemap.html免插件制作攻略

乐分享主编 2019-11-21 300 阅读

web互联网老站长聊到SEO经常会出现的词必定有Sitemap了,Sitemap不止能提高搜索引擎对全站的抓取从而提升流量,在用户体验的角度来看也是有一定的帮助的,今天给大家分享乐分享也用到的sitemap代码,演示可参考:https://www.cxvn.com/sitemap.html ,截图如下

<?php
/*
Template Name: Sitemap
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" />
<title>站点地图 - <?php bloginfo('name'); ?></title>
<meta name="keywords" content="站点地图,<?php bloginfo('name'); ?>" />
<meta name="copyright" content="<?php bloginfo('name'); ?>" />
<meta name="author" content="CXVN.COM" />
<link rel="canonical" href="<?php echo get_permalink(); ?>" />
<style type="text/css">
body {font-family: Microsoft Yahei,Verdana;font-size:13px;margin:0 auto;color: #000000;background: #ffffff;width: 990px;margin: 0 auto}
a:link,a:visited {color:#000;text-decoration:none;}
a:hover {color:#08d;text-decoration:none;}
h1,h2,h3,h4,h5,h6 {font-weight:normal;}
img {border:0;}
li {margin-top: 8px;}
.page-sitemap { background: #eee; }
.sitemap-box { margin: 25px auto; padding: 2%; width: 92%; line-height: 24px; background: #fff; }
.sitemap-box h1 { margin-bottom: 20px; font-size: 20px; text-align: center; }
.sitemap-box a:link, sitemap-box a:visited { color: #333; }
.sitemap-box #breadcrumb, .sitemap-box .full-version { border: 1px solid #eee; background: #f8f8f8; }
.sitemap-box .archivers { padding: 5px 15px 15px; overflow: hidden; }
.sitemap-box #breadcrumb, .sitemap-box .archivers, .sitemap-box .full-version, .sitemap-box #footer { margin-top: 20px; padding: 6px 15px; border: 1px solid #eee; border-top: 1px solid #ddd; clear: both; }
.sitemap-box #footer { padding: 10px; text-align: center; }
</style>
</head>
<body class="page-sitemap">
<div class="sitemap-box">
<h1>
<a href="<?php bloginfo('url'); ?>/" rel="home"><?php bloginfo('name'); ?></a>的网站地图</h1>
<div id="breadcrumb">
<a href="<?php bloginfo('url'); ?>/">
<strong><?php bloginfo('name'); ?></strong></a>&nbsp; » &nbsp;
<a href="<?php echo get_permalink(); ?>" title="<?php bloginfo('name'); ?>SiteMap">SiteMap</a></div>
<div class="archivers page-list">
<h2>全站页面</h2>
<ul>
<?php wp_page_menu( $args ); ?>
</ul>
</div>
<div class="archivers category-list">
<h2>全站栏目</h2>
<ul>
<?php wp_list_categories('title_li='); ?>
</ul>
</div>
<div class="archivers post-list">
<h2>最新内容</h2>
<ul>
<?php
$previous_year = $year = 0;
$previous_month = $month = 0;
$ul_open = false;

$myposts = get_posts('numberposts=-1&orderby=post_date&order=DESC');

foreach($myposts as $post) :
?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" target="_blank"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<div class="clearfix"></div>

<div id="footer">
<p>Copyright © 2019
<a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a> All rights reserved.</p></div>
</div>
</body>

</html>

 

最新游戏