and a but more info the_content(); does not return any data.
Also whne I turned on debug = true I got this:
Fatal error: Call to a member function get_template() on a non-object in /var/www/xxx/htdocs/wp-content/plugins/wp-ultimate-recipe/wp-ultimate-recipe.php on line 268
Plugin Author
Brecht
(@brechtvds)
Hi there,
Do you a “Default Recipe Template” set on the Recipes > Settings > Recipe Template page?
Brecht
Yes, as I mentioned I get the error in the preview of the recipe, If I save the recipe and publish then I can view the recipe.
Plugin Author
Brecht
(@brechtvds)
Oh, it’s only an issue when previewing?
Could you try switching to a default theme (like Twenty Sixteen) and see if it works then?
I already did that – I have tried disabling all plugins (except for WP Ultimate Recipe), and changed to a Twenty Sixteen theme. I just get the title of the recipe and nothing else on the page!
Plugin Author
Brecht
(@brechtvds)
Oh right, you mentioned that in your first post. Sorry.
Does it happen for every recipe?
All the ones I have tried that are in draft.
Is there any way I can call and echo the content and the template? I can edit single.php file for my theme for the preview in a recipe post.
Just so you know we do have:
function wpurp_recipe_content_loop_check( $ignore_query )
{
if( is_main_query() ) $ignore_query = false;
return $ignore_query;
}
add_filter( ‘wpurp_recipe_content_loop_check’, ‘wpurp_recipe_content_loop_check’ );
Plugin Author
Brecht
(@brechtvds)
Just using the_content() should be fine. That custom should also not be an issue.
What version of WordPress are you using?
the only way I can get content to show is to use: echo get_post_field(‘post_content’, $post->ID);
and that does not show the formatted recipe.
Plugin Author
Brecht
(@brechtvds)
Using the_content() works when you’re not previewing, so there should be no need to change that.
I’m not sure what else we can try. I cannot replicate the issue on my end (using Twenty Sixteen) and haven’t heard about this issue from anyone else either.
is there anyway to have the function Call to a member function get_template() on a non-object in /var/www/xxx/htdocs/wp-content/plugins/wp-ultimate-recipe/wp-ultimate-recipe.php on line 268
call a default template if it cannot find the one I set?
I am happy to play around editing return $this->addon( ‘custom-templates’ )->get_template( $type, $template ); to see if I can work out what is happening….
S
Plugin Author
Brecht
(@brechtvds)
What does this return:
var_dump( $this->addon( 'custom-templates' ) );