Fixing Issue with WordPress Defaulting Pages to index.php

Warning
This blog post is included for archival purposes and may contain outdated information. While it provides historical insights, we strongly recommend that you double-check the details before relying on any of the information outlined here.

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:

Changing the permalink of the 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

About Author

Christian Saborio

Christian is a seasoned computer engineer with a rich career spanning collaborations with industry leaders such as Artinsoft (now Mobilize.net), Microsoft, HP, and Intel. As a technical evangelist and trainer, Christian honed his expertise in Costa Rica and Seattle, delivering impactful solutions and sharing his knowledge.

Now based in Sydney, Australia, Christian channels his passion into web development, leading a talented team to tackle diverse projects with innovation and precision. His commitment to crafting exceptional digital experiences reflects his deep-rooted enthusiasm for technology and problem-solving.

Comments

    Comments are closed

    Thank you for your interest. Please fill out this form to provide us with your contact information. We'll get back to you as soon as possible.