Skip to content

Instantly share code, notes, and snippets.

@jarednova
Last active September 22, 2022 17:34
Show Gist options
  • Save jarednova/2e63ad0e3ba92cc37903 to your computer and use it in GitHub Desktop.
Save jarednova/2e63ad0e3ba92cc37903 to your computer and use it in GitHub Desktop.
$context = Timber::get_context();
$context['slides'] = Timber::get_posts('post_type=slides');
$context['pages'] = Timber::get_posts('post_type=page&posts_per_page=2');
$context['portfolio'] = Timber::get_posts('post_type=portfolio');
$context['posts'] = Timber::get_posts(); //leave blank for default page query
Timber::render('front-page.twig', $context);
{% for slide in slides %}
{% include 'tease-slide.twig' %}
{% endfor %}
{% for page in pages %}
<article>
<h3>{{page.title}}</h3>
</article>
{% endfor %}
{% for item in portfolio %}
{% include 'tease-portfolio.twig' %}
{% endfor %}
{% for post in posts %}
{% include 'tease-post.twig' %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment