jamie
jamie

Reputation: 47

Change Wordpress Timber Template locations

I need to overwrite the page template locations for Woocommerce using timber Wordpress.

All page Templates are stored in the theme root folder and i want to move the woocommerce files (like single-product.php) to a custom subfolder.

The folder should be in the same theme (my-theme/custom/single-product.php)

I have read around on google but haven't been able to find a definitive answer. Thanks

Upvotes: 2

Views: 1149

Answers (1)

JAstuccio
JAstuccio

Reputation: 1580

<?php
/* functions.php */
Timber::$dirname = array( 'templates', 'templates/woo-templates');

http://timber.github.io/timber/#changing-the-default-folder-for-twig-files

The code above will first look in templates and then in the woo-templates sub directory for .twig templates

Upvotes: 2

Related Questions