Last active
August 29, 2015 13:57
-
-
Save jarednova/9922455 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$context = Timber::get_context(); | |
$context['work'] = Timber::get_posts('post_type=work&numberposts=25'); | |
$context['posts'] = Timber::get_posts(); | |
Timber::render('index.twig', $context); |
The idea is to avoid automatic in favor of explicit (and hopefully, brief). Your index.twig
might look like this:
<section id="posts">
{% for post in posts %}
{% include "tease-post.twig" %}
{% endfor %}
</section>
<section id="work">
{% for work_item in work %}
{% include 'tease-work.twig' with {post:work_item} %}
{% endfor %}
</section>
Sorry to take so much of your time.
I have this sort of working but it is still putting both of these on the same page
(and another issue where it cannot find any of the 'work' posts.
is the upstatement site set up in a way that would work? would it be easier for me to go through those files rather than asking you questions left and right?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for all the help!
I understand this, but how can I get this to connect posts to the standard blog page, and work to the work page that i have created in wordpress?
would I..
Timber::render('work.twig', $context);
or should it automatically figure this out?