Ah ok!
This is absolutely possible via filters, but it will require some additional coding to:
– Add new schema.org type.
– Create new custom post meta fields for the new type.
– Override schema.org markup output to reflect changes.
P.S. Check the links in the points above, and find out more snippets in these gists at GitHub..
The thing here is Schema plugin won’t have this code, this is because the goal of the plugin is to support a basic setup of WordPress. Other features shall be provided via the Theme, or another plugin extension.
I am working on creating a couple of useful extension, which will allow you to add more schema.org types. I am trying my best to make this happen soon! (That’s why I am planning to offer these as paid extensions)
For the default image, you can install the Schema Default Image plugin. Or if you prefer a function:
function schema_wp_set_default_image_12345( $json ) {
// If image is already defiend,
// return our $json array and do not do anything
if ( isset($json['media']) && ! empty($json['media']) ) return $json;
// There is no image defined in Schema array,
// set default ImageObject url, width, and height
$json['media']['@type'] = 'ImageObject'; // schema type, do not chage this!
$json['media']['url'] = 'https://default-image-url.png'; // set default image url
$json['media']['width'] = 720; // set image width
$json['media']['height'] = 400; // set image height
return $json;
}
add_filter('schema_json', 'schema_wp_set_default_image_12345');
I hope this helps.
-
This reply was modified 7 years, 6 months ago by
Hesham Zebida. Reason: add resources