Existing page templates can be edited, but new ones don’t appear in the drop down list. I’ve tried restarting the local machine, restarting the computer, exporting and re-importing the site, and ensuring that development mode is on.
Hi Mike,
Are you on macOS or Windows?
Also, can you please try going to Preferences » Advanced and toggle “Faster Docker Volumes” on or off depending on what the setting currently is?
Hi Clay,
I’m on Windows. FDV is turned off. I should also mention that I’ve cleared the browser cache as well. Not sure that matters for template files, but I’ve done it all the same.
Edit: Just re-read your response and tried switching FDV to “on” then applying the setting. Local crashed. Same thing happened when I restarted it and switched it back to “off”. No effect on the template file issue.
Got it. Thanks for trying!
Can you send the top part of the template file? The part where you define the name?
I turned off Dev mode and the template was present in the list. Turned it back on and it’s still there. Any idea why the issue would have occurred?
Here’s the code you asked for anyway:
<?php
/*
Template Name: Menus
*/
?>
It’s tough to say. I think it was probably fixed by turning Faster Docker Volumes on then back off.
For anyone else who stumbles upon this thread, I came across this which has some recent activity: https://stackoverflow.com/questions/3987773/template-dropdown-not-showing-up-within-wordpress-administrator-page
I tried another template file addition and ran into the same issue, so I tried a few things from that stack overflow post. The one thing that seemed to work was ensuring that a version number was in the style.css head as per this answer, and possibly adding a “!” (minus quotes) after the opening comment tag, as per this answer.
The new template file only showed up when I updated the version number in style.css…That’s kind of annoying to have to do every time…
Interesting. What version of WordPress are you running?
Version 4.9
Thanks, I’ll try that in the morning. I love the suggestion of “waiting 60 minutes for the cache to expire!” So practical. Facepalm.
One thing you can also try is right-clicking on the site in Local’s sidebar, going to “Open SIte SSH” and running the following command: wp transient delete --all
That works. Thanks for your help!