Forum

Thread tagged as: Question, Blog

How do I make a blog post with a custom template?

I've created a blog with 2 separate sections, and would ideally like to use different templates for blog posts depending on what section they are in.

I can do this with the listing page using perch_blog_custom, but can't work out if this is possible for the actual post, ie. can I use 'perch_blog_post(perch_get('s'));' with a custom template, rather than the default post.html?

Gareth Fisher

Gareth Fisher 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

All perch_blog_post() does is make a call to perch_blog_custom()

perch_blog_custom([
    'filter' => 'postSlug',
    'match' => 'eq', 
    'value' => perch_get('s'),
    'template' => 'my_awesome_template.html',
]);

Thanks, got it working now :)

Also works for me, thanks! I think we can mark this one as solved.