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 am having a strange problem with a site I am currently building. I will try to give as much detail as possible in the hopes that somebody is able to figure out what is causing this :)

Overview of the problem

Each time I update a page, all the pages on my site except the homepage, start using the index.php template. Even when pages have a template assigned to them, they still revert to the index.php template.

To fix it, I need to change the permalinks to default, save it, and then put them back to my custom setup which is category/postname. Though next time I update a page, it happens again.

Plugins & Post Types I am using the following plugins, not sure if any of this matters.

  • Advanced Custom Fields
  • Custom Post Type UI

I used Custom Post Type UI to create five custom post types and ten custom taxonomies. For the custom post types, I am using the following settings:

  • all names start with ph_ to keep things unique and not cause conflicts
  • Public, Show UI, Has Archive, Hierarchical and Rewrite are all set to True

The rewrite slugs being used are:

Name/Rewrite Slug

ph_slider/ph_slider (no change)

ph_rental/rental-boiler

ph_new/new-boiler

ph_used/used-boiler

ph_services/boiler-service

I also have pages with the following names/slugs

Boiler Services/boiler-services (plural, post type rewrite is singular)

New Commercial Boilers/new-commercial-boilers

Rental Commercial Boilers/rental-commercial-boilers

Used Commercial Boilers/used-commercial-boilers

Obviously, some of the names are similar between post types and pages but they are not the same and should not cause a conflict.

Conclusion

Does this make sense to anyone? I can supply access to the WP site if needed. I am stuck and can't figure this out. I have setup a number of sites with custom post types in the past and have never run into this issue.

I really appreciate any help that you can give. If you need additional information, let me know and I will be glad to supply it.

Thanks!

EDIT - more details

I meant to include, when I deactivate Custom Post Type UI, I can edit a page and the templates stay correct. Once I activate it again though, everything breaks on an update. So I have narrowed it down to definitely being the cause of the problem - but why?

EDIT - figured it out

I had a custom taxonomy with the name "year", after renaming that everything seems to be working. Sorry for not realizing that from the start, but maybe somebody will come across this when they have a problem and know the reason now :)

share|improve this question
    
I think a link to the site would be helpful. Please ensure that you are using both the body_class() and the post_class() template tags correctly in your Theme, as these will aid in troubleshooting. –  Chip Bennett Apr 6 '12 at 15:11
    
@ChipBennett link I have the body_class tag used, not the post_class but can add it in if needed. Right now, all the pages are showing the index.php template. –  Adam Apr 6 '12 at 15:18
    
Yes, please do add the post_class() template tag. It helps with troubleshooting post-type related issues. –  Chip Bennett Apr 6 '12 at 15:29
    
@ChipBennett Ok, I will do that. First though I just narrowed it down even more on my localserver. When I deleted all 10 of the custom taxonomies I created using the Custom Post Type UI plugin, the problem went away. Now, I need these taxonomies for a complex backend I have setup on this site. Is it a known issue with custom taxonomies? They are all set to Hierarchical so the client could easily check off what they needed. –  Adam Apr 6 '12 at 15:34
1  
I'm glad you found the solution! Please be sure to post it as an answer, and then accept that answer. :) –  Chip Bennett Apr 6 '12 at 16:03
show 2 more comments

1 Answer 1

I had a custom taxonomy with the name "year", after renaming that everything seems to be working. Sorry for not realizing that from the start, but maybe somebody will come across this when they have a problem and know the reason now :)

Not sure why the taxonomy name of "year" caused this issue, but after all the testing it was clearly the cause.

share|improve this answer
add comment

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.