TwigPress
This plugin provides a simple way for you to use the Twig templating system within WordPress themes.
Envisager une alternative
TwigPress shows warning signs in 2026 — compare the alternatives below before installing. It runs on 20+ sites, is rated 5/5 and was last updated 12 years ago, and scores 31/100 on our health check.
- Petite base d'utilisateurs (20+ installations actives)
- Très peu de critiques jusqu'à présent
- Pas de mise à jour dans 11 ans
- Uniquement testé jusqu'à WordPress 4.1 (le dernier est de 7,1)
Comment s'accumule-t-il ?
Côte à côte sur les installations, les mises à jour, les évaluations et le supportTéléchargements quotidiens
Les pics de téléchargement suivent généralement une nouvelle version - chaque site qui met à jour automatiquement compte comme un téléchargement.
Classements
Where TwigPress stands todayWordPress.org Classements de recherche
Position en direct dans la recherche de plugins, Top 100| Mot-clé | Position |
|---|---|
| modèles | >100 |
| themes | >100 |
| twig | #83 |
Adoption de version
Part de sites actifs par version.
Répartition des notes
★★★★★ ★★★★★ 5 sur 2 avis
About TwigPress
À partir du Lisezmoi officiel · v1.1.2Description
This plugin provides a simple way for you to use the Twig templating engine with WordPress themes. A problem with WordPress themes is that it is very easy to create templates that are a mess of PHP and HTML. This isn’t good for working with neither does it provide a separation of concerns. The Twig templating engine is a great engine that allows you to separate out getting & manipulating your data and rendering it out. You create your themes in the same way as before, only you render a template instead of using PHP within your page structure.
The Installation section provides the steps to using this plugin with your theme.
In the Other Notes section, there is an easy reference for the different functions/filters and what they can be used for.
For Twig, the Twig documentation is the best resource I can offer. It is extremely well documented.
Functions and Filters
Functions
twigpress_render_twig_template($vals = array(), $template = false, $echo = true)
Calling this function renders a $template with the values passed in $vals. You can also choose a specific template to render and whether you would like to echo the template or simply return it.
There is no need to explicitly set the $template name. If this is left to the default, the plugin will look for a template with the same name as the PHP file being rendered (with a ‘.twig’ extension). For example, if front-page.php is being rendered the plugin will attempt to find front-page.twig.
If you wish to simply return the rendered template, set $echo to false.
twigpress_get_the_content()
Use this function to get the content for the post you are dealing with. If you use get_the_content, WordPress returns the unformatted content and the the_content filter is not applied. twigpress_get_the_content() takes care of both of these tasks.
Filtres
twigpress_twig_site_variables
This filter is applied when the plugin is instantiated, on the ‘init’ action, and allows you to alter the array of variables that are passed to the Twig environment when it is first created. As such, these variables are available to all templates. This filter is best suited for site-wide information. For post-specific variables, use the twigpress_twig_post_template_vars filter.
Defaults:
'site' => array(
'lang_attributes' => get_bloginfo('language'),
'charset' => get_bloginfo('charset'),
'url' => get_bloginfo('url'),
'stylesheet_directory' => get_stylesheet_directory_uri(),
'title' => get_bloginfo('name'),
'description' => get_bloginfo('description')
)
In templates these would be accessible through, for example, {{ site.stylesheet_directory }}.
twigpress_twig_global_functions
There will be times when you need to use PHP functions in your templates, and there is no way to capture their content to pass to the template when it is rendered. This filter gives you access to the array of functions that are added to the Twig environment, making them available for calling in your templates.
Defaults: wp_head(), wp_footer(), wp_title(), body_class(), wp_nav_menu()
twigpress_twig_post_template_vars
This filter is applied to your passed array of $vars immediately before the template is rendered. This filter is ideal for when you have a set of default variables you wish to include in every template, but are related to posts not the entire site.
Installation
- Download the plugin from WordPress, either directly or through the plugins admin screen
– If you download the files directly, upload them to your/wp-content/plugins/directory - Place the Twig files in your
wp-contentdirectory,Autoloader.phpshould reside atwp-content/Twig/Autoloader.php - Create a ‘twigs’ directory inside your theme folder, place your Twig templates in here
- Activez le plugin via le menu « Plugins » dans WordPress
- Use the
twigpress_render_twig_template()function in your PHP files to render templates
Journal de modifications
1.1.2
- [Added] If WP_DEBUG is enabled, turn on debugging in the Twig environment
1.1.1
- Strict variables are no longer enforced
1.1.0
- [Added] TwigPress now sets up a template cache in your theme folder
- [Added] TwigPress sets the Twig core to recompile templates when the source code changes
- [Added] TwigPress sets the Twig core to enforce strict variables, which stops silent failure
1.0.1
- Minor changes to codebase
1.0.0
- Communiqué initial
Pour les développeurs
Est-ce votre plugin ? Montrez les chiffres.
Ajoutez un badge en direct à votre site, docs ou github readme. Il se met à jour par lui-même - aucun compte n'est nécessaire.
Best TwigPress alternatives
All templates plugins →FAQ
TwigPress: quick answers
Réponses directes, extraites des données en direct WordPress.org.
Source : WordPress.org
Is TwigPress free?
Yes. TwigPress is free to download and use from the official WordPress.org plugin directory.
Is TwigPress safe to use in 2026?
TwigPress shows warning signs in 2026 — compare the alternatives below before installing. It runs on 20+ sites, is rated 5/5 and was last updated 12 years ago, and scores 31/100 on our health check.
How many websites use TwigPress?
TwigPress is active on 20+ WordPress websites and has been downloaded 4,140 times since it launched in May 2013. It was downloaded 52 times in the last 30 days.
Does TwigPress work with WordPress 7.1?
TwigPress is officially tested up to WordPress 4.1.42, while the latest release is 7.1.5. It may still work, but try it on a staging site first.
When was TwigPress last updated?
The latest version, 1.1.2, was released on February 22, 2015 (12 years ago).
Who makes TwigPress?
TwigPress is developed and maintained by MikeShaw217.
What are the best alternatives to TwigPress?
The most popular alternatives to TwigPress are Starter Templates: AI-Power… (1M+ installs), Extendify (500K+ installs) and Template Kit – Import (400K+ installs).
Propulsé par PageForge
Un modèle et une feuille de calcul. Une vraie page pour chaque recherche.
PageForge transforme chaque ligne d'un CSV en une page WordPress avec son propre titre, URL, SEO et schéma, construit sur la mise en page que vous Déjà conçu. Gratuit sur WordPress.org.
- CSV et XLSX, plus Google Sheets sur les professionnels et les entreprises
- Son propre titre, URL, SEO champs et schéma pour chaque page
- Fonctionne avec l'éditeur de blocs, Elementor, Divi et Avada
- Gratuit sur WordPress.org, pas de carte de crédit
