Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I recently switched themes, and my old theme had templates for sitemap and archive (in fact the archive was one of my most viewed pages.) When I switched themes the link to the archive and sitemap page still works, but they are blank pages. I really need to get this fixed, and I have no idea how. I'm assuming I need to recreate a new template in the parent theme for the sitemap and archive page (I'm using a child theme). I've never created one before, and with my old theme it was very simple since I could just use the template.

Could someone help me get this up and going on my new theme? Thanks.

share|improve this question

3 Answers 3

Just add the page/custom templates to your child theme such as page-sitemap.php in the child theme's folder.

That way your page with the slug 'sitemap' will inherit that template file.

share|improve this answer
    
I'm not sure how to create a template. Can I just copy and past the page-sitemap.php file from the old theme into the new one? There is a lot of code in there, and I'm not sure what it all does. Would the old template work in this new theme? –  Rick Smith Mar 5 '12 at 16:21
1  
Don't name the custom template file page-sitemap.php. The page-{foobar}.php naming convention is part of the Template Hierarchy, and can lead to unexpected results. Use something like template-sitemap.php instead. –  Chip Bennett Mar 5 '12 at 16:27
    
@RickSmith if you have a page-sitemap.php file from the old theme just copy it over to the child theme. It may need some editing but it should work. By having page-sitemap.php means the page with slug sitemap will use the template without having to set up custom templates. –  Alex Older Mar 5 '12 at 16:38
    
@ChipBennett and when I look in my old theme I see a archieve.php, an archives.php, and a sitemap.php. (not sure why there is an archieve and a archives) What should I do with this? Also, I'm not sure what would need editing. Is there any code I can paste in there that would show you what needs to be done? –  Rick Smith Mar 5 '12 at 16:54
1  
@RickSmith archive.php is part of the Template Hierarchy. archives.php is a Custom Page Template. If you need help with any specific file, I would recommend copying the code into a Pastebin and linking from within your original question. –  Chip Bennett Mar 5 '12 at 17:07

I have a different take on this question. I think this is a great example of when a theme is shouldn't be used to create content or implement functionality (which overlap here).

I would encourage you to find plugins to recreate these pages. Then, if you ever change themes again, the content of the pages isn't lost. You may have to restyle some of that content, but that's where themes should be used.

All the discussion about the archives.php standard template hierarchy file is relevant and worth using, but if you want custom Archives (e.g. not the ones WordPress provides by default like Category, Date, and Author), then I think plugins make sense for this task.

I know JetPack comes with an [archive] shortcode that might be useful. There are a bajillion site map plugins out there, so I assume it won't be hard to find a decent one (although make sure you're looking for a Site Map Page plugin and not a sitemap.xml plugin, although some provide both).

share|improve this answer
up vote 0 down vote accepted

I ended up just using the template that Wordpres.org provides. Everything seems to be working fine now. thanks!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.