Convert Timber 1 to composer timber/timber


min read

My profile

Share this:


Remove from your composer.json

"wpackagist-plugin/timber-library": "version_here",


composer require timber/timber:^1.0

Several calls need to use:

use Timber\Timber;
use Timber\Post as TimberPost;

Some PHP calls:

- return \Timber::get_posts($args); 
+ return Timber::get_posts($args);

Making sure that the right twig folder is used:

- Timber::$dirname = array('templates', 'views');
+ $timber = new Timber\Timber();
+ //
+ Timber::$dirname = [ 'templates' ];
Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *