Use Timber in Theme and Plugin #2815
Unanswered
AfterglowWeb
asked this question in
Q&A
Replies: 1 comment
-
Start of an answer ; The only workaround I found is to leave Twig templating in the theme and only share datas between plugins and themes through custom WP filters and actions hooks. It is a consistant approach but not convenient at all if you are making plugins for unknown context. Some usefull Timber helpers are missing too of course. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there, I believe the question has been asked but I can't find any recent answer.
Our use case needs Twig templating in both theme and plugins.
The several Timber instances are conflicting on template directory and adding php functions to Twig.
My ideas are :
• filling a global with Timber object.
• making a minimal plugin with Timber and provide hooks so other components can use it.
Does anyone here would have a workaround idea please ?
Beta Was this translation helpful? Give feedback.
All reactions