Skip to content Skip to navigation

PHP 8 upgrade for Wordpress Stanford Theme

Posted by: 

Thank you, Wolfe Gleitsman!
Hi all- we've recently run into a fatal error with the Redwood WP Theme after our server bumped us up to PHP version 8.  

So for anyone else with this PHP 8 fatal error in the Redwood WP Theme, if you're not running the Timber plugin, you can clear the error by changing line

1396 in wp-content/themes/redwood-theme-master/vendor/twig/twig/src/Extension/CoreExtension.php

(as the error messaging suggests).

Adding (array) to the second argument seems to be sufficient to solve things:

1396: if (isset($object->$item) || \array_key_exists((string) $item, (array)$object)) {

Unfortunately, activating the Timber plugin still leads to the previously mentioned errors, but I'll share again if I can get that cleared