@lukasluke, @antongorlin and others, you can make different schema types for different posts via the rmp_schema_type filter. Now, there are many ways how to do this, but maybe the easiest is this one:
You create a custom field in posts that require different schema type than the one declared in the options. Here is a guide on how to create a new custom field: https://www.namehero.com/startup/how-to-use-custom-fields-in-gutenberg-screenshots-example/
The custom field’s name should be my_schema_type and the value should be one of the following: Product, Book, Course, CreativeWorkSeason, CreativeWorkSeries, Episode, Game, LocalBusiness, MediaObject, Movie, MusicPlaylist, MusicRecording, Organization, Recipe.
Then the following should go in your functions.php:
function my_dynamic_schema( $schemaType ) {
$schema = get_post_meta( get_the_id(), 'my_schema_type', true );
if( $schema ) {
return $schema;
}
return $schemaType;
}
add_filter( 'rmp_schema_type', 'my_dynamic_schema' );
Then if you need a different schema than the one in the options, you just create a custom field my_schema_type with the schema value in the post editor and that’s it.
It’s not the simplest implementation but it works ?? I’m planning to redesign this as soon as I get some free time.
Regards,
Blaz
-
This reply was modified 5 years, 2 months ago by Blaz K..