When we upgrade from 5.0.4 to 5.1.1 the site stops loading.
The error message is
Fatal error: Uncaught Error: Call to a member function images_path() on null
/wp-content/themes/mytheme/header.php on line 49
Line 49 is
<?php $theme->images_path(); ?>
above it in the same file is
global $theme;
$theme is created in functions.php as the instance of our custom theme.
class MyTheme {
private $theme_name = "MyTheme";
private $scripts_version = '0.90';
function __construct() {
add_action('init', array($this, 'init_assets'));
...several of these
...more methods
}
}
...other stuff
$theme = new MyTheme();
I don't know how to troubleshoot this issue. Everything worked great prior to the upgrade and no other changes were made to the site.
Any help appreciated.
global $lp_theme;
before trying to use it.