Custom Post Type Template with TImber

Question

I’m using Timber Theme and Struggling somewhat with displaying content on a custom post-type-template:

I have set up single-stories.php with a relevant twig file and tested that it works.

in the single.php I have the following

$context = Timber::context();
$posts = Timber::get_posts(array('post_type' => 'stories'));
$context['stories'] = $posts;

The twig file:

{% for story in stories %}
        {{post.content}}

        {{post.title}}
        {{post.date}}

    {% endfor %}

Any help is appreciated.

0
user5288 2 months 2021-09-26T15:26:35-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse