I have a WP problem that's driving me crazy. I have created several templates, and it decides to switch them all the time... I think it does when I create a new template file, but it never did that before. I'm scared that it's actually when I edit a post that it messes up some other page because if it is, I'll have a mad client on the phone every other week so I'ld like to know if anyone know what the problem might be...

PHP files names are structured like that : template-something.php

They are directly on my theme's folder.

Inside these I put this comment :

/* Template Name : Page Something */

And then it's usual php... Anyone know how this could happen ? I have used templates several times and never had this problem...

  • 1
    you'll have to do some debugging and figure out what's causing this. disable plugins and use a core bundled theme. the selected template for a page is stored in that page's post meta, so if that value is somehow changing, you've got code in a theme or plugin that is updating post meta where it shouldn't. – Milo Apr 29 '14 at 15:59
  • I disabled all plugins, removed everything I added from the functions.php file, and still nothing. We figured it was when updating pages that it switched... We have a lot of template pages and it switches to the next template in the list... I just don't understand what the problem is. – Matoma16 Apr 30 '14 at 12:17
  • I tested with the twenty-fourteen theme and it does exactly the same thing. – Matoma16 Apr 30 '14 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.