Home Timber get_posts in template/view
Reply: 0

Timber get_posts in template/view

philsbury Published in 2017-12-07 21:47:42Z

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.297548 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO