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:
1 2 3 4 5 |
public function get_post_templates() { // If you screw up your current theme and we invalidate your parent, most things still work. Let it slide. if ( $this->errors() && $this->errors()->get_error_codes() !== array( 'theme_parent_invalid' ) ) { //return array(); } |
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.