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": "https://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.