This is just a quick fix for this annoying WordPress bug.


Why The Box Disappears (One Reason)

Most recently, I have been digging even deeper into WordPress than ever before and as it happens I found one cause for the mysterious bug that results in a missing page template box (the one you can select page templates from)

One of the reasons is whenever you modify style.css and move it to style2.css or remove the theme information at the top of style.css (Name, Author, etc) then you will end up with an active but broken theme. One result is that the page template box disappears.

The solution is fairly easy:

1. Make sure to add all necessary theme information at the top of style.css
2. Rename your CSS file to style.css – you can host it on a CDN but you need to keep a local copy for WordPress or it will break.
3. Deactivate your theme, then re-activate it

Move Page Templates Into Sub-Folder: Warning

Also, most recently I started organizing my themes a little and wanted to move page templates into a sub-folder. WordPress now supports that (it uses the PHP function scandir for that, so don’t block scandir via your PHP.ini – make sure to remove it from the line disable_functions) so moving it works but it also breaks your page templates

1. Move one by one

2. After each move, open the page and re-assign the page template

This will avoid any issues and possibly losing many page template assignments.