If you can find the list of page templates in the page editor on WordPress try this quick fix that will probably help.

In the function get_post_templates()  which is located in wp-includes/class-wp-theme.php
star the part of the return array;  in the first part of the function:


This might show a few errors on the form, but at least you’ll be able to choose or change a template to a page.

For a permanent solution try to print the error before the function’s return;

From my experience, a lot of things can cause this bug to appear, for example, if your style.css file is missing.

Leave a comment