Hi @revivalz71,
I have a tutorial about how to add SoftwareApplication schema in the documentation: https://blazzdev.com/documentation/rate-my-post-documentation/#filters. In the PRO version it will be possible to add it without coding. I’m glad you like the plugin.
Regards,
Blaz
I found a website that uses the My Rate Post plugin and uses the great Schema SoftwareApplication in one of these posts: https://kuotareguler.com/app/uc-browser/ Schema SoftwareApplicatin is valid without errors.
Maybe you can ask the website admin for the code.
@nadianadine,
as explained above, the tutorial on how to add the SoftwareApplication schema is available in the documentation. Search for “Example 2 – Change schema type to SoftwareApplication”.
Regards,
Blaz
Hi,
I modified the code in the documentation so that the SoftwareApplication schema is valid there are no warnings.
You can add this code to the very bottom of your WordPress theme’s functions.php file.
function blazzdev_sa_structured_data( $structuredData ) {
$voteCount = rmp_get_vote_count();
$rating = rmp_get_avg_rating();
$img = get_the_post_thumbnail_url();
$name = get_the_title();
$description = get_post_meta( get_the_id(), 'myschema_description', true );
$operatingSystem = get_post_meta( get_the_id(), 'myschema_operatingSystem', true );
$applicationCategory = get_post_meta( get_the_id(), 'myschema_applicationCategory', true );
$pubdate = get_the_date();
$priceCurrency = get_post_meta( get_the_id(), 'myschema_priceCurrency', true );
$price = get_post_meta( get_the_id(), 'myschema_price', true );
$structuredData = '
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "SoftwareApplication",
"name": "' . $name . '",
"image": "' . $img . '",
"description": "' . $description . '",
"applicationCategory": "' . $applicationCategory . '",
"operatingSystem": "' . $operatingSystem . '",
"datePublished": "' . $pubdate . '",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "' . $rating . '",
"ratingCount": "' . $voteCount . '"
},
"offers": {
"@type": "Offer",
"priceCurrency": "' . $priceCurrency . '",
"price": "' . $price . '"
}
}
</script>
';
return $structuredData;
}
add_filter( 'rmp_structured_data', 'blazzdev_sa_structured_data' );
Then you need to add some custom fields to your post. See the image below.
https://prnt.sc/r317wt
I hope this helps.