When the latest version of WordPress (4.9) was released, it also contained a strange little bug that was introduced with some of the modifications to the internal “file editor” in WordPress. This bug caused page templates to either not display properly in the Page Edit screen or to not update until the default WordPress cache was cleared (60 minutes). But there is a quick fix you can place into your theme’s functions.php file that will automatically clear the cache of the theme so you don’t have to wait for the cache to clear or raise your theme’s version number.
Here is an example code snippet:
Or you can use a code snippet/plugin provided by the greater WordPress community:
Thanks to the WordPress community for sharing variations of this fix. Note: This bug will be fixed in an upcoming version of WordPress, so once that is fixed, you’ll be able to remove this code from your active theme’s functions.php file.