Creating a Site Map

by Shana,Fri 22nd Dec, 2006, in categories: Using Blogsome

This post has been slightly rewritten. For the latest version, go to How to Create a Site Map.

In the main index.html file, under the {$content} tag, add the following code:

{if $smarty.server.REQUEST_URI == '/sitemap'}
<ul>{wp_list_pages}</ul>
<h2>Categories</h2>
<ul>{list_cats optionall='1' all='All' sort_column='name' optioncount='0' children='0' hierarchical='1'}</ul>
<h2>Posts</h2>
<ul>{get_archives type='postbypost' limit='' format='html'}</ul>
{/if}

Create a page called sitemap and add the following to the ‘Page Content’ section:

<h3 class="storytitle">SiteMap</h3>

Check the above code matches that in your posts template. In your stylesheet, add the following, changing where necessary to suit your blog design:

/* sitemap styles */
#content h2 {
margin: 0px 0px 5px 0px;
font: bold 1.0em Verdana, Geneva, Arial, Helvetica, sans-serif;
text-align: left;
padding: 0;
color: #8D513D;
}
#content ul {
margin: 5px 0 10px 0;
padding: 0;
}
#content li {
list-style-type: none;
margin: 0;
padding: 0 0 0 5px;
}
li#pagenav {
margin: 0;
font: bold 1.0em Verdana, Geneva, Arial, Helvetica, sans-serif;
text-align: left;
padding: 0;
color: #8D513D;
}
#content li a{
margin: 0;
padding: 0;
font: 0.95em Verdana, Geneva, Arial, Helvetica, sans-serif;
text-decoration: none;
color: #D1790C;
}
#content li a:visited {
margin: 0;
padding: 0;
font: 0.95em Verdana, Geneva, Arial, Helvetica, sans-serif;
color: #999;
text-decoration: none;
}
#content li a:hover {
margin: 0;
padding: 0;
font: 0.95em Verdana, Geneva, Arial, Helvetica, sans-serif;
color: #94593B;
text-decoration: underline;
}

The URI for your sitemap will be; http://yourblog.blogsome.com/sitemap