timber call wordpress build in functions
{{ function('wp_login_form', {object: args}) }}
set different language for different user
add_filter(‘locale’, ‘wpse27056_setLocale’);
function wpse27056_setLocale($locale) {
if ( is_admin() ) {
return ‘en_US’;
}
return $locale;
}
timber slice array
<div class="col_half nobottommargin">
<ul>
{% for tag in tags|slice(0, tags|length // 2) %}
<li><a class="btn btn-secondary" href="{{ tag.link }}" role="button">{{ tag.name }}</a></li>
{% endfor %}
</ul>
</div>
<div class="col_half nobottommargin col_last">
<ul>
{% for tag in tags|slice(tags|length // 2, tags|length-1) %}
<li><a class="btn btn-secondary" href="{{ tag.link }}" role="button">{{ tag.name }}</a></li>
{% endfor %}
</ul>
</div>
Was this article helpful?
This article is viewed 46 times!