Disappearing page templates thanks to bad taxonomy naming

On one of my other sites, I’ve recently transferred all the old, static content into a WordPress installation, so that I can WordPress as a CMS. The content is divided into five main categories, and for each category I’ve created a custom page template. The main menu links to the category pages, making them “category portals”, so to speak. And it looks good.

But yesterday, WordPress stopped using the custom page templates, and defaulted to index.php on all of my pages. But in the admin area, the pages were still listed as using the templates, and the files were actually still on the web server. I tried to upload the theme once more, without it helping, and also reinstalled WordPress through the Dahboard -> Updates screen without result. It was not until I turned off and on again my custom permalink structure that it went back to normal. My custom structure was /%category%/%postname%/ and choosing default, saving, and choosing custom structure once more, solved it. Or so I believed.

Because this morning, the custom page templates did once again not work. And I had to turn the custom structure off and on again to make it go back. And it was ok for about ten minutes, before defaulting back to the index.php again.

After some time looking angrily at my screen, it dawned on me that it might have something to do with my custom taxonomies. I had set up a taxonomy named year, that i used for the posts. In retrospect, not a very good name for a taxonomy. I had not managed to get any output for this taxonomy yet, and had kind of given up yesterday. Not one before I discovered the defaulting. So I deleted the taxonomy from the functions file, and no the problem seem to be solved.

So the moral of the story has probably something to do with naming conventions. Well, well…

Post a Comment

Your email is kept private. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>