Closed frontenddevguy closed 3 years ago
It looks like you have registered the post type 'developments', plural and the template you have is singular, 'single-development.php', so updating that to 'single-developments.php should fix it.
Ah such an obvious thing, I thought I had tried it already. For some reason I was thinking the singular / plural naming was working (using the 'singular_name').
Anyway, this works with single-developments.twig, and also does not require the single-developments.php file either.
I can see this:
else {
Timber::render( array( 'single-' . $timber_post->ID . '.twig', 'single-' . $timber_post->post_type . '.twig', 'single-' . $timber_post->slug . '.twig', 'single.twig' ), $context );
}
in single.php is working as expected.
I've been unable to get the single twig templates for a custom post type to work.
My developments.twig page correctly lists the posts in custom post type developments.
However, the single template defaults to single.twig, rather than single-development.twig. In single-development.php I have:
Like some others suggested I resaved the permalinks but that didn't help.
In timber-functions.php I have:
How is this structure supposed to work.. have I missed something?