question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom post template - Inconsistent documentation and not working if implemented

See original GitHub issue

Issue Summary

This section of documentation states that Ghost supports custom post templates if you create a post-{{slug}}.hbs theme file:

http://themes.ghost.org/docs/templates

However, this same page then refers you to this link for more information: post-context

This page states:

The post context always uses the post.hbs template. This template is required in all Ghost themes. At present there is no support for custom post templates as there is for pages.

So I’m confused as to whether this is currently supported or not?

Steps to Reproduce

  1. I currently have a post titled “Test” with a post-slug of test.
  2. I adapted post.hbs to include a couple of extra scripts in the page
  3. I published the page

When I inspect the html for the page, it is clear that the default post template is still being used. info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
ErisDScommented, Feb 7, 2017

This feature doesn’t need the Public API to be enabled and it does work in both 0.11.4 and the latest master. I’ve tested out both just now.

You do need to restart Ghost when adding new templates via the file system though - not sure if that’s what’s tripping folks up here.

1reaction
kirrg001commented, Aug 8, 2018

Do the post-{{slug}}.hbs files live in the root of the theme or in the partials directory?

In the root folder. Please double check that you are editing the correct theme.

Please open a forum topic to get further help. We can re-open this issue if there is a bug in Ghost.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My template for custom post type is not working - WordPress.org
Hello. I am trying to create a custom template for custom post type. My custom post type is teams. I have changed the...
Read more >
wordpress custom post template not working - Stack Overflow
1 Answer 1 ... Simply technologies.php by itself is not enough for WordPress to recognize automatically. You need to rename the theme file...
Read more >
How to Create a WordPress Single Post Template - Elementor
Create your own WordPress single post template from scratch, no coding skills needed! In this tutorial, we will show how you can design...
Read more >
Content template not applied to the post - Toolset
Solution: It turns out that the user's theme does not have a proper template to display single posts(single.php or single-{cpt-slug}.
Read more >
Template Design and Analysis: Integrating Informatics ... - NCBI
Standardized template design is a useful tool to improve clinical documentation and reliable reporting of health care outcomes when constructed with clear ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found