google网站管理工具使用,我不再多作描述了简单的在google网站管理工具页面用google账户登录,根据网页提示说明做就行,主要是要用这个管理工具,还需要提交一个xHtml Sitemap,和xml sitemap是有区别的。后者是比如google xml sitemap等插件可以直接生产的。我就只介绍生产xHtml sitemap的方法:
1)把你正在用的主题(theme)中的page.php到本地并重命名为sitemap.php,用下面内容替换sitemap.php文件内容:
<?php
/*
Template Name: Sitemap
*/
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<p><strong><a href=”<?php bloginfo(‘url’); ?>” alt=”<?php bloginfo(‘name’); ?>”>Home</a></strong></p>
<h3>All internal pages:</h3>
<ul>
<?php wp_list_pages(‘title_li=’); ?>
</ul>
<h3>All internal blog posts:</h3>
<ul>
<?php $archive_query = new WP_Query(‘showposts=1000′);
while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
<li><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a> <strong><?php comments_number(’0′, ’1′, ‘%’); ?></strong></li>
<?php endwhile; ?>
</ul>
<h3>Monthly archive pages:</h3>
<ul>
<?php wp_get_archives(‘type=monthly’); ?>
</ul>
<h3>Topical archive pages:</h3>
<ul>
<?php wp_list_categories(‘title_li=0′); ?>
</ul>
<h3>Available RSS Feeds:</h3>
<ul>
<li><a href=”<?php bloginfo(‘rdf_url’); ?>” alt=”RDF/RSS 1.0 feed”><acronym title=”Resource Description Framework”>RDF</acronym>/<acronym title=”Really Simple Syndication”>RSS</acronym> 1.0 feed</a></li>
<li><a href=”<?php bloginfo(‘rss_url’); ?>” alt=”RSS 0.92 feed”><acronym title=”Really Simple Syndication”>RSS</acronym> 0.92 feed</a></li>
<li><a href=”<?php bloginfo(‘rss2_url’); ?>” alt=”RSS 2.0 feed”><acronym title=”Really Simple Syndication”>RSS</acronym> 2.0 feed</a></li>
<li><a href=”<?php bloginfo(‘atom_url’); ?>” alt=”Atom feed”>Atom feed</a></li>
</ul>
<div></div>
<?php endwhile; endif; ?>
2)把sitemap.php上传到你的主题目录下,通常为/wp-content/themes/yourtheme/目录下;
3)在后台建立一个页面,标题自定,post slug可以写成sitemap,模板选择sitemap,然后发布;
4)OK,你的xHtml Sitemap已经完成;
现在,你可以在google网站管理工具里检验和设置相关的了。去试试吧。
阅读全文…