How to Create Sitemap and Archives for a Blog with Thesis Theme

In this video tutorial deals about how to create site-map and archives for your blog. Normally thesis theme offers thesis options and design options. Inside the thesis options we can choose our archives pages similar to home page, or only title or like teaser box or post excerpts. Which type we want we can select in the display options. But the number of posts appear in the single archive page is equal to the number of posts in homepage display.

In order to get all the posts of your blog in single page we need to create site map for your blog. The below video will explain how to create site-map for your blog contains categories, pages, archive by month and all the posts.

To create site-map, archive by categories and archive by month you should follow below steps.

Step 1:

First you should create a page in the name of site-map. Go to word press admin select ‘add new’ under pages tab and create site-map page. You can give your site-map to your visitors by placing it on navigation menu or in sidebar. So readers can easily find out your total site structure and which post they need.

Step 2:

Once you created the page, copy and paste the below code in custom_function.php file

remove_action('thesis_hook_archives_template', 'thesis_archives_template');
add_action('thesis_hook_after_post', 'custom_sitemap');

function custom_sitemap() {
if (is_page('204')) { ?>
<div class="sitemapl">
<?php wp_list_pages('title_li='); ?>
<h3>By Month:</h3>
<?php wp_get_archives('type=monthly'); ?>
<h3>By Category:</h3>
<?php wp_list_categories('sort_column=name&title_li='); ?>
<div class="sitemapr">
<h3>Last 50 posts:</h3>
<?php wp_get_archives('type=postbypost&limit=50'); ?>
<?php } }

The above code you should replace the page id 204 with your site-map page id. Here I removed thesis archive template and added custom site-map.

Step 3:

In order to get page id, go to ‘pages’ in wordpress dash board. Under pages click edit option. Then hover the mouse cursor on site-map page. The site-map page id will display in status bar which shown in below image.

site-map page id

You can limit your number of post display. The above code I have used only last 50 posts. If you want you can use 100 or remove the limit 50 then it will display all the posts in your blog form the latest.

Step 4:

Now you can style your site-map page by using the below css code. Copy and paste it in custom.css file.

/* custom  sitemap and archives page */
.custom .sitemap h3 {margin-top: 0;}
.custom .sitemap ul {font-size: .85em; }
.custom .sitemapl { float: left; width: 30%;}
.custom .sitemapr { float: right; width: 70%;}

The above code I have used archive by categories, pages and posts font-size and location for the above you can place any where in the page by adjusting site-map. If you need only posts in site-map you can remove all others like page, categories and etc also use width as 100%. Once you created the site-map, your site-map looks like the below image.

Sitemap for a blog

Step 5:

Add site-map in navigation menu for this go to thesis options in wordpress admin. Select navigation menu and add the site-map page in menu. By drag and drop the site-map page you can place the position in navigation menu. Share your experience in comment section. For more checkout our all Thesis theme tutorials..

{ 57 comments… add one }

Leave a Comment

Cancel reply

  • Sergio January 20, 2010, 11:31 PM

    Thank you Pascal, it works very nice!

    • Pascal January 24, 2010, 8:31 PM

      Glad it worked nice. 🙂

  • BestofBlogger February 19, 2010, 3:16 AM

    Thank you, Sitemap works at my blog also. You can check here:

    • Pascal February 19, 2010, 10:14 AM

      I saw your site. It’s working fine.

  • Suresh February 22, 2010, 9:41 AM

    hai vivek,

    In your sitemap custom functions code change 'type=postbypost&limit=100' into 'type=postbypost&limit=' it will solve your problem.

  • Steve March 12, 2010, 10:45 PM

    I have a question…How can I create a page that lists all of my categories on a full page?

    • Suresh March 12, 2010, 11:20 PM


      The above post we have list of pages, monthly archive and categories within the div name called id=”sitemapl”..

      If you need only categories remove others..

      also in css code we have sitemapl width=30% make it as 100% to display categories in full page…

  • Games March 16, 2010, 3:03 PM

    It works nicely, thanks for your great and very easy tutorial. U can see my sitemap here

    Thanks alot,

    • Pascal March 16, 2010, 6:41 PM

      Your Sitemap fits well in center of the page.

      Thanks for making use of our tutorials. For more thesis tutorials, don’t forget to subscribe on our youtube channel

  • Cliff March 18, 2010, 9:03 PM

    Thanks very much for this post. It has been informative and helpful. I now know how to add these to my site :-).

    • Pascal March 18, 2010, 9:23 PM

      You are welcome, Cliff!

  • Farnoosh March 24, 2010, 3:21 PM

    I followed these instructions word for word and when I pasted your code below in my custom_functions.php, I got this error and it brought my whole site down:

    Parse error: syntax error, unexpected ‘}’ in /home/fbahram/ on line 179

    I don’t know any php. I did not see anything on line 179. There is no code after line 150ish. I replaced with a old customer functions.php but just an FYI.

    • Suresh March 26, 2010, 3:06 PM

      hai farnoosh,

      check your custom functions code.. each function has open and close brace { }. I think one close brace is missing or extra brace in available in your custom function.php file .. check out this..

      • Farnoosh March 26, 2010, 5:43 PM

        Naturally that’s what I did… I will go through and check it again this weekend. I didn’t think I have to worry about anything other than pasting the code in…..Do I not do that at the very end of a perfectly working custom_functions.php? Where does the extra one pop in then? Thanks!

        • Suresh March 27, 2010, 10:51 AM


          add the code at the end of the custom functions.php file.. it will work fine..

  • Suresh March 30, 2010, 10:48 AM

    hai aviationMY,

    Just change the page title in your wordpress admin… dont change the page URL.. If you changed the url webmaster shows the 404 not found error for previous url. so change only the title of the page…
    sitemap tilte will automatically changed.

    • Suresh March 30, 2010, 7:02 PM


      I am not clearly getting what you are asking about.. tell me with details..
      do you want to change the page url?
      http://fourblogger/sitemap is the sitemap page url of fourblogger
      do you want to change the page title The New world Map?
      What you need instead of page title?.
      If you are using any slug plugin it may shorten your page url .
      eg; into

    • Suresh March 30, 2010, 7:08 PM


      You can also change the page title and url in different words as you like..
      but it’s good for SEO.
      your page URL should be a particular word of page title or the whole part of page title..

  • elbenno April 4, 2010, 12:06 PM

    THANK YOU !!!

    it works fine

    • elbenno April 4, 2010, 1:17 PM

      Sorry! New Name, new Link:

      Seems to have interferences with the sitemap.xml from the “Google XML Sitemaps” – Plugin by name.

      • Pascal April 4, 2010, 8:42 PM

        Your sitemap and archive page both are fine.

        • aviationMY April 5, 2010, 11:43 PM

          Hi, just saw your YT channel..

          man..the cap is suit with you..
          i just want to drop a comment but it say error..

          so i commenting here..

          keep up the good work Pascal..but one thing to ask..

          what i can video about thesis rules in Google..

          • Pascal April 6, 2010, 12:04 AM

            Hi Aviation, Thanks for comment.

            Our blogging lab videos will aslo rule in Google. I am trying to make it soon.

            Just now I checked in youtube. I am receiving comments and my test comment also worked well…

    • Pascal April 4, 2010, 8:40 PM

      Glad it works for you. I got your another comment with new archive link.

  • Suresh April 5, 2010, 11:08 PM

    hai mayank,

    I saw your site.. your site map is working fine.. if you have further problem leave a comment..

  • Pascal April 6, 2010, 9:41 AM

    Hi Mayank,

    In your page, you have installed already the google xml sitemap. So you can’t get the archives page in that page. If you want to do so, first you have to change the google xml sitemap page to another page. For this go to your google xml sitemap plugin and change the page name sitemap.xml into some other thing. Then you can create the archives page in

    But remember, when you change google xml sitemap to some other place name, you have to go and replace the new sitemap link in Google webmasters(if you have already given the sitemap in google webmasters).

    I suggest you that don’t change the xml sitemap position. create your archives in

    • Pascal April 6, 2010, 6:16 PM

      Hi Mayank,

      I don’t know what settings makes you in problem.

      Try this… uncheck the box in “Write a normal XML file (your filename)” and check the box in “Write a gzipped file (your filename + .gz)” at Google Xml sitemap and try again…

      I haven’t tested this..try and tell me what happens..

      • Suresh April 9, 2010, 3:42 PM

        hai mayank,

        First deactivate the google xml sitemap plugin (even delete the plugin is good)and remove if you are already submitted sitemap in search engines.

        Now create new page in the name of sitemap. the page url should be your
        once it created now you can activate xml sitemap (inatall plugin) and submit xml sitemap in search engines.

        If the page is not created with this URL go in sdie the blog directory using FTP
        open the folder, In side this folder you have the file sitemap delete this file now again create the page with the url

        The problem may be the url has been first assigned xml sitemap.
        ultimately the page url becomes site-map or sitemap1. so first create page then install xmal sitemap..

        • Suresh April 9, 2010, 4:50 PM

          have you created page? while publishing the page what it shows..
          give your page url

          • Suresh April 11, 2010, 9:57 AM

            check your google xml sitmap plugin settngs
            check automatic detection file name sitemap or sitemap.xml?
            if it is sitemap change it into sitemap.xml

            the file detected path should be
            also you have file in your blog directory remove this file using ftp
            the path is

            check out my page which has the same problem like you previously its is working fine now i changed the file name sitemap instead of sitemap.xml after that it shows the xml version of the sitemap.
            for your your sitemap page shows zipped version of sitemap thats why it down loaded.

            after updating the settings wait until the next sitmap has build. it has been indicated in your xml sitemap settings option.

  • Extreme Acai May 16, 2010, 11:09 PM

    That is amazing thanks a lot it just worked amazing

    • Suresh May 16, 2010, 11:36 PM

      hai Extreme Acai,
      Thanks.. get more tutorials on our youtube channel..

  • Beckz@tutorial wordpress May 25, 2010, 5:12 AM

    oks, my blog is new and I forget about it… lets do the game! 🙂
    thanks again Pascal! 😀

  • James Issac June 20, 2010, 11:32 PM

    Hey i must say that em here very late mate! but i guess not that late.
    well its really a informative portal man keep it up…
    U are like mi teacher in this thing bro…
    Thanx alot Yoo..

    • Pascal June 21, 2010, 5:38 AM

      You are welcome James. Get download all the free guides. If possible, you can join in upcoming membership site. Thanks bro. Pascal.

  • Gabrielle June 24, 2010, 1:34 AM

    That is an amazing tutorial!!! Thank you very much. You saved me a lot of time having to piece together other articles and then trying to decipher code language and Thesis functions. Thanks!!!

  • Vincent July 29, 2010, 12:21 AM

    Another great tutorial! I find myself being directed here for every Thesis related search query I have….


  • WP Content Plugins August 9, 2010, 1:48 AM

    What about Nofollow Tags. Should we add nofollow tag to our archive page or not.

  • Paramjit August 27, 2010, 2:16 PM

    Thanks for the great tutorial. I discovered that my images in Thesis were not being picked up by Google. It was not being picked up in the sitemap either. Its OK if you insert the image directly into the article but doe snot work if you include the image in the special location provided in the thesis theme. have you experienced this before?

  • Justin September 27, 2010, 6:56 PM

    Very good – thanks Pascal!!

    Question: Do I need to submit this sitemap to google now or will it happen automatically?


  • SJ December 13, 2010, 2:00 AM

    Hi Suresh,

    Is it possible to adapt your code to create a sitemap page that only shows a listing of posts from one category? (I know this isn’t a true sitemap, but it would serve a good purpose on my site.)

    Thank you,

  • Sascha February 28, 2011, 10:24 PM

    Very Nice Tutorial, thank you.

  • rakesh kumar March 16, 2011, 9:41 PM

    Nice Tutorial , But does this sitemap is also indexed by Google or other search engine.

  • Adrian March 22, 2011, 3:33 PM

    Thank you for sharing this Thesis sitemap tutorial. Works like a charm!

    • Adrian March 22, 2011, 4:44 PM

      Actually – a word of caution. I tried on a second site and my site went down. Luckily I had a backup of my custom_functions but please proceed with caution,

  • Sherri May 5, 2011, 4:32 AM

    This worked like a charm! Thank you!!

  • Ed May 25, 2011, 8:04 AM

    Hello, i set up my sitemap fine. Thank you. Now I am trying to submit my sitemap in my webmaster tools account, but it is telling me it is a wrong format. Says it can not be HTML. Error says “Sitemap is HTML
    Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead.” How do I submit this sitemap to webmaster? Thanks Ed

  • admin May 27, 2011, 9:55 PM

    Hi Ed,

    There are two kind of sitemaps.
    One is html sitemap which is for our site users. An example of this sitemap page is and in the above tutorial, I taught about that only.

    The another one sitemap is for Search engines. This should be in the “xml” format.
    I did a video about how to create xml sitemap and submit. The link is here.

  • Gouri November 14, 2011, 11:03 PM

    Thanks for this helpful post on customizing archives page. Is there a way to display only categories and split it into 2 or more columns?

    • FourBlogger November 17, 2011, 7:20 AM

      if you go through the above given code, you can cleary see what parts of the codes shows what. So you can keep and remove what you want from the code.

  • Rasel Rony December 18, 2011, 3:31 PM

    Hey guys, I’ve successfully created sitemap and archive page, thanks fourblogger

  • How2Blog February 7, 2012, 6:17 PM

    Thnx sir 🙂 Works pretty fine.

  • mazdodot April 13, 2012, 6:40 PM

    Great guys, good job. That’s code work fine for my blog…Thank you.

  • Sean Grimes July 4, 2012, 1:25 PM

    Thanks for the great tutorial. This is just what I wanted and it was easy to implement.