I want to create a child theme using Timber.
So I have :
- installed Timber (composer require timber/timber)
- created a mytheme folder in the themes folder
- in my mytheme folder, created :
- a style.css file with just the basic information about the theme (/* Theme Name: mytheme */)
- a functions.php file
- an index.php file
When I activate my theme as is, everything works fine.
However, as soon as I try to initialise Timber ($timber = new Timber();) I get several error messages:
- Deprecated: Creation of dynamic property TimberIntegrations::$wpml is deprecated in ... \vendor\timber\timber\lib\Integrations.php on line 33
- Warning: Cannot modify header information - headers already sent by . \vendor\timber\timber\lib\Integrations.php:33 in ..\web\wp\wp-admin\includes\misc.php on line 1431
- Warning: Cannot modify header information - headers already sent by ..\vendor\timber\timber\lib\Integrations.php:33 in ..\web\wp\w-includes\functions.php on line 6896
- Warning: Cannot modify header information - headers already sent by ..\vendor\timber\timber\lib\Integrations.php:33 in \web\w\p\w-admin\admin-header.php on line 9
- Warning: Cannot modify header information - headers already sent by \timber\timberlib\Integrations.php:33 in ..\web\wp\w-includes\option.php on line 1156
- Warning: Cannot modify header information - headers already sent by ..\vendor\timber\timberlib\Integrations.php:33 in \web\wp\w-includes\option.php on line 1157
Has anyone ever encountered the same problem ?
PS : I installed my WordPress with Bedrock
"Deprecated: Creation of dynamic property" is new in PHP 8.2.
I just had the same issue and resolved it (for now) by using PHP 8.1 instead.
In the long run this is up to Timber to sort as the source of the deprecation points to that package.