Home Timber get_posts in template/view
Reply: 0

Timber get_posts in template/view

user659 Published in April 20, 2018, 10:42 am

I have an ACF field that allows a choice of post types, these are then going to be put in a carousel. There could be any number as every module on the page is controlled by the admin users.

In the carousel template, I want to be able to get the recent posts for the selected post type. I can to this with:

{% set items = fn('get_posts', {'post_type': 'team' }) %}

Is there a way to do this without calling it as a function? I was thinking along the lines of:

{% set items = Posts(params) %}

Is this possible or is the function call the only/best way?


You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.344748 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO