-1

I would like to just return a list of the last 10 posts that only includes the title and permalink.

What is the best way to accomplish this in Timber?

bigmike7801
  • 3,908
  • 9
  • 49
  • 77

1 Answers1

0

Without knowing which page you're targeting, it's hard to provide something definitive. But assuming it's the default "WordPress Query" those last 10 posts will come in automatically on the home page, so in Twig you'd just need to do:

{% for post in posts %}
  <h2><a href="{{ post.link }}">{{ post.title }}</a></h2>
{% endfor %}
Jared
  • 1,724
  • 12
  • 16