Support » Plugin: RecipePress Reloaded » Compatibility with the Dyad 2 theme
Compatibility with the Dyad 2 theme
-
Most probably the theme is only looking for posts of type
post
and nor forrpr_recipe
. So this problem affects all plugins creating a new post type.I’ll have a deeper look into the code of the theme as soon as possible.
As I thought: this feature of jetpack (https://jetpack.com/support/featured-content/) is not implemented in a way at dyad2 to show anything else than normal posts.
Ininc/jetpack.php
line 17 the function to pull posts for featured content is defined like this://Featured content add_theme_support( 'featured-content' , array( 'featured_content_filter' => 'dyad_2_get_banner_posts', 'max_posts' => 6, 'post_types' => array( 'post' ), ) );
according to jetpack’s feature page this should include recipes as well
add_theme_support( 'featured-content', array( 'featured_content_filter' => 'dyad_2_get_banner_posts', 'max_posts' => 20, 'post_types' => array( 'post', 'rpr_recipe' ), ) );
Manually editing the file might not be the best idea, as each update of the theme will break it. Maybe ask the developers of the theme to add an option to include other posts types as well. Or think about creating a child theme.
Finally: This is not a issue of RecipePress reloaded!
Thanks for the support, though the issue is not RecipePress reloaded.
I created the child’s theme, but I do not know how to edit the inc/jetpack.php file in it.
In the moment I changed the original theme, the edit shows the “featured content”, but not the summary of the post in the rest of the theme
Please read the documentation. It’s of no help if you do things without understanding what is happening.
Just a little hint: You need to copy the file you want to change /overwrite to your child theme and edit it there.
That’s what I did, but modify the file in the child theme does not work.
I will try to get help from the creators of the theme.
I contacted the support of theme to add compatibility with other types of post, i’m waiting for a reply.
As for the excerpts the problem seems to be the plugin, I tried several other themes, and no one shows them.
I will have a deeper look into this as soon as possible.
From the code of the theme it should be working. Please have a little patience.Alright, that was my mistake.
Quick fix: Add the following line at public/class-rpr-public.php in line 231:
return $content;
The complete block of code then should look like this:
/* Only render specifically if we have a recipe */ if ( get_post_type() == 'rpr_recipe' ) { remove_filter('get_the_excerpt', array( $this, 'get_recipe_excerpt' ), 10); $recipe_post = get_post(); $content = $this->render_recipe_excerpt( $recipe_post ); return $content; add_filter('get_the_excerpt', array( $this, 'get_recipe_excerpt' ), 10); } else { return $content; }
I will add this fix to the next release, but this might take some time.
Quite obvioulsy most themes (including the default theme TwentySeventeen, …) do not seem to be affected by this bug.
I made the change, now the theme (Dyad 2) shows the beginning of the post of the recipe, but not its excerpt as it should. This is true both to the “Featured content” and to the list of all posts, and only to posts of RecipePress, the normal ones are correctly displayed.
EDIT
Trying to save a new recipe now I get the error “There was an error doing autosave”, and what is written in the excerpt field is replaced by the description.-
This reply was modified 4 years, 11 months ago by
Effef.
This is a feature and not a bug.
The ‘excerpt field’ in the editor is not the same as ‘the excerpt’.
The excerpt as displayed on the front page is a composition of several data (including categories, tags and other meta data) as defined by the layout files of RecipePress.
As some themes do not make use of thethe_excerpt()
function provided by wordpress but rather take the value aof the excerpt field directly from tha database, the plauginsaves the description into the excerpt field to provide at least some data in this case.The austosave message seems to be a quite annoying yet harmless bug, as the saving of data still works.
Accordingly is it not possible to have a description and excerpt different from each other?
No, this is currently not possible.
I see. Hope, if it is possible, that this feature will arrive in future, it would be useful to me.
Thanks for the support.
-
This reply was modified 4 years, 11 months ago by
- The topic ‘Compatibility with the Dyad 2 theme’ is closed to new replies.