0

I have a bunch of templates that I have in folders in my main folder. I know wanted to move all of these into a "templates" folder to make my code base more clean and easy to navigate. I also re-named the template name themselves since they were badly named from the start.

When I moved the template files into the new templates folder all pages that used the templates were of course unlinked as expected. But I now find 2 issues that I cannot figure out:

  1. In one of the cases I still found the old template name in the dropdown list of templates, and when I linked it with the old name the page shows up as expected. Even if the file itself have the different Template Name. Why?
  2. In another case the template dissapeared completely from the dropdown list and I therefore can't link it. Why?

Here is the general code for a template file:

<?php
/* 
 * Template Name: My New Template 1
*/

I have read about this on the forums and find an answer from 2017 where they say files are only re-scanned every hour. Is this still the case?

I also tried to reload cache, hard reload from inspect, restart the entire computer but nothing works. Any guidance how I can smoothly change template names and immediately link them to the pages again?

UPDATE:

It's been 2 hours, still the same situation. What is going on? I tried to create a completely new template but it is not showing up either.

1 Answer 1

0

I found it out myself just after playing around with it. Apprently I can't have my_template_file_1.php too deep in the folder structure. I could have it in myTheme/templates/my_template_file_1.php but if I put it in myTheme/templates/my_template_1/my_template_file_1.php it dissapeared from the templates dropdown.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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