Functions - miya0001/content-template-engine GitHub Wiki
There are some conditional functions assigned from WordPress.
is_home()
is_front_page()
is_single()
is_sticky()
is_page()
is_category()
is_tag()
is_tax()
is_author()
is_date()
is_year()
is_month()
is_day()
is_time()
is_new_day()
is_archive()
is_search()
is_404()
is_paged()
is_attachment()
is_singular()
is_feed()
is_user_logged_in()
in_category()
For example:
{% if is_home() %}
<h2>Hello {{ post.acf.your_name }}!</h2>
{% endif %}
You can include specific post into the post/page.
Following example includes post that has id 1234
.
{% include_post( '1234' ) %}
See also Twig official documentation.