Support » Plugin: Rate my Post - WP Rating System » How to use SoftwareApllication properly?

  • Resolved Rafalor

    (@rafalor)


    Hi there, i was trying to implement the SoftwareApllication model for my posts, but, wehn i try to implement the code in the functions.php, nothing happens.

    I’m trying to follow the instructions here: https://blazzdev.com/documentation/rate-my-post-documentation/#filters, but maybe i lack the coding knowledge to do that…

    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();
      $operatingSystem = get_post_meta( get_the_id(), 'myschema_operatingSystem', true );
      $applicationCategory = get_post_meta( get_the_id(), 'myschema_applicationCategory', true );
    
      $structuredData = '
      <script type="application/ld+json">
        {
        "@context": "http://schema.org",
        "@type": "SoftwareApplication",
        "aggregateRating": {
          "@type": "AggregateRating",
          "bestRating": "5",
          "ratingCount": "' . $voteCount . '",
          "ratingValue": "' . $rating . '"
        },
        "image": "' . $img . '",
        "name": "' . $name . '",
        "description": "' . $name . '",
        "applicationCategory": "' . $applicationCategory . '",
        "operatingSystem": "' . $operatingSystem . '"
        }
      </script>
      ';
    
      return $structuredData;
    }
    
    add_filter( 'rmp_structured_data', 'blazzdev_sa_structured_data' );

    Nothing new is shown in the plugin pannel and nothing in post editor.

    I’m using a theme called Newspapper and i really need to implement this.

    Here is how my functions file looks like: https://drive.google.com/file/d/11zhLunpGP82384YVBH2cE2E4J6zA4Cu_/view?usp=sharing

    Any help is welcomed, Thank’s

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use SoftwareApllication properly?’ is closed to new replies.