Closed minthemiddle closed 8 years ago
Hi @minthemiddle - this is probably due to us removing some functionality to do with 'guessing' what class you want. Could you please try the following:
$post = Timber::get_post(array(), 'TimberPost');
Ok, let me test this locally.
Any luck @minthemiddle ?
Actually try, TimberPost(false, 'TimberPost')
- I am not sure what you are trying to do with this code however? The first parameter should be your query, and the second parameter is already \Timber\Post
by default. So this doesn't seem to be doing anything?
You could actually just remove your call completely and it will work, as $post
will already be defined by wordpress in single.php
I'm going to close this as the Timber::get_post
call you are doing isn't valid
Expected behavior
In version 0.22.5 I could load a template for all custom posttypes via
function.php
and the following settings:(single.php)
Actual behavior
With version 1.0, I get with my custom posttype
unternehmen
such as in this link the following error:PHP Fatal error: Uncaught Twig_Error_Loader: Unable to find template "single-.twig"
What version of WordPress, PHP and Timber are you using?
Wordpress 4.5.1, Timber 0.22.5 (no error), Timber 1.0 (breaks custom posttype twig loader)