Whilst working with a customer WordPress page and getting ready to call it a day, I quickly visited the site’s section. Everything seemed fine, except two Pages that had their own custom templates were displaying index.php, which means WordPress was not finding pages.php and defaulting. However I *did* have a pages.php and everything was working five minutes prior!
I did the ‘ctrl-alt-delete’ of WordPress when things go astray: went to settings and regenerated the permalinks. No luck. I was about to go mad when I just thought of changing the permalink link of the actual Page:
After carrying out that change and saving changes, the section displays in its full glory again.
Definitely a bug in WordPress, but I thought I’d share this workaround.
WordPress Version: WordPress 4.8.1
PHP Version: 5.5.14