Filters
Generate handle from string ( use Wordpress sanitize_title function )
{{ 'My title'|handle }}
--> output : my-title
Handle Wordpress "Read more" tag
{{ post.content|more|raw }}
Resize image
<img src ="{{ post.thumbnail|resize(800,600) }}"/>
Generate picture
{{ post.thumbnail|picture(1280, 680, {'max-width: 420px':[420,665], 'max-width: 768px':[768,820]})|raw }}
--> ouput
<picture>
<source media="(max-width: 420px)" srcset="/uploads/image-420x665.webp" type="image/webp"/>
<source media="(max-width: 420px)" srcset="/uploads/image-420x665.jpg" type="image/jpeg"/>
<source media="(max-width: 768px)" srcset="/uploads/image-768x820.webp" type="image/webp"/>
<source media="(max-width: 768px)" srcset="/uploads/image-768x820.jpg" type="image/jpeg"/>
<source srcset="/uploads/image-1280x680.webp" type="image/webp"/>
<img src="/uploads/image-1280x680.jpg" alt="" loading="lazy" width="1280" height="680"/>
</picture>
Functions
Execute php functions
{{ fn('sanitize_title', 'My title') }}
{{ function('sanitize_title', 'My title') }}
{{ shortcode(post.content) }}
{{ archive_url('guide') }}
{{ attachment_url(10) }}
{# post_url(value, type) #}
{{ post_url('My post', 'title') }}
{{ term_url(10, 'item') }}
{{ dynamic_sidebar(1) }}
{{ is_active_sidebar(1) }}
{{ _e('Submit') }}
{{ __('Submit') }}
Fire the wp_head action
Fire the wp_footer action.
Instantiate Wordpress bundle post entity
{% set post = Post(10) %}
Instantiate bundle user entity
{% set user = User(10) %}
Instantiate bundle term entity
{% set term = Term(10) %}
Instantiate bundle image entity
{% set image = Image(10) %}
Generate transparent image placeholder
<img src="{{ pixel(10,20) }}"/>