Custom query on get_posts();
-
Hello, how could I get my array of posts as Timber object if I use custom query?
I am using $wpdb->get_results with my custom sql to get those posts, but now I need them on Twig template. If I put them to $context[‘posts’] I can’t see anything on the template this way. I need to convert it to Timber object somehow. Or is it possible to use Timber::get_posts() with some kind of custom sql code in it? WP_Query array of arguments is not enough as it is shown here https://github.com/jarednova/timber/wiki/Timber-docs#get_posts
Thank you.
The topic ‘Custom query on get_posts();’ is closed to new replies.