Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor dudo

    (@dudo)

    Open file yasr-functions inside the lib directory and on line 322 change this

    $div_1 = "<div class=\"yasr_schema\" itemscope itemtype=\"http://schema.org/Product\">";

    with the needed itemtype.

    In future I will add an option to choose it

    Best,
    Dario

    Thread Starter eclassifiedads.org

    (@eclassifiedadsorg)

    I changed it to:

    $div_1 = “<div class=\”yasr_schema\” itemscope itemtype=\”http://schema.org/Review\”>”;

    And I’m getting this error in the Structured Data Testing Tool:
    Error: Incomplete microdata with schema.org.

    Thread Starter eclassifiedads.org

    (@eclassifiedadsorg)

    For me the solution was to change this name property from itemprop=”name” to itemprop=”about” on line 323.

    That cleared the error. But I’m not sure if that was the best solution, I await your input.

    Thread Starter eclassifiedads.org

    (@eclassifiedadsorg)

    the itemprop=”about” on line 323 is pulling the TITLE, I need it to pull the AUTHOR, what do I need to change?

    Plugin Contributor dudo

    (@dudo)

    From line 322 to line 331 remove old code and paste this

    $div_1 = "<div class=\"yasr_schema\" itemscope itemtype=\"http://schema.org/Product\">";
    $title = "<span itemprop=\"name\">". get_the_title() ."</span>";
    $author = __( ' written by ' , 'yasr' )  . "<span itemprop=\"author\">" . get_the_author() . "</span>";
    $span_1 = "<span itemprop=\"aggregateRating\" itemscope itemtype=\"http://schema.org/AggregateRating\">";
    $rating = __( ' average rating ' , 'yasr' ) . "<span itemprop=\"ratingValue\">" . $average_rating . "</span>/<span itemprop=\"bestRating\">5</span>";
    $n_ratings = " - <span itemprop=\"ratingCount\"> " . $visitor_rating['votes_number'] . "</span>" . __(' user ratings', 'yasr');
    $end_span_1 = "</span>";
    $end_div_1 = "</div>";
    
    $schema = $div_1 . $title . $author . $span_1 . $rating . $n_ratings . $end_span_1 . $end_div_1;

    change div1 with what you need

    Thread Starter eclassifiedads.org

    (@eclassifiedadsorg)

    Done. Changed div1 to Review and Title ietmprop from name to author. No errors…BUT in the Structured Data Testing Tool, the stars are not showing up now. Thats not good πŸ™

    http://www.eclassifiedads.org/workout-fitness-fun-just-30-minutes/

    Plugin Contributor dudo

    (@dudo)

    first line is wrong, must be like this

    $div_1 =<div class=\"yasr_schema\" itemprop=\"review\" itemscope itemtype=\"http://schema.org/Review\">

    Thread Starter eclassifiedads.org

    (@eclassifiedadsorg)

    Did that – still no stars in in the Structured Data Testing Tool.

    Plugin Contributor dudo

    (@dudo)

    Sorry, the review itemtype can’t be used along with aggregate rating.

    See this page http://schema.org/Thing you can choose what is best for you in the “More specific Types” section

    Thread Starter eclassifiedads.org

    (@eclassifiedadsorg)

    I changed it to BlogPosting, I think that is most accurate. When you update the plugin can you include the BlogPosting itemtype please.

    Plugin Contributor dudo

    (@dudo)

    Not from the next release (0.5.8), but however I will add the an option to choose wich snippet use asap

    Plugin Contributor dudo

    (@dudo)

    I’ve just released version 0.5.9
    You can choose the itemtype while writing a post or page: if you want to use BlogPosting, select “Other”

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘itemtype, Product’ is closed to new replies.