Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPS-826: Product Image in Product schema for AIOSRS #158

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et

## Changelog ##

### 1.6.11.1 ###
- Fixed: Product image schema error in Product schema.

### 1.6.11 ###
- Fixed: Improved code quality syntax and security checks for better coding standards and practices.
- Fixed: Recipe - Author type fix.
Expand Down
5 changes: 5 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ function display_rich_snippet( $content ) {
$product .= '<span itemprop="ratingValue">' . average_rating() . '</span>';
$product .= ' based on <span class="rating-count" itemprop="reviewCount">' . rating_count() . '</span> votes </span></div></div><div class="snippet-clear"></div>';

$product .= '<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">';
$product .= '<meta itemprop="contentUrl" content="' . esc_url( $product_image ) . '">';
$product .= '<link itemprop="url" href="' . esc_url( $product_image ) . '">';
$product .= '</div>';

if ( '' != trim( $product_brand ) ) {
if ( '' != $args_product['product_brand'] ) {
$product .= '<div class="snippet-label-img">' . esc_attr( stripslashes( $args_product['product_brand'] ) ) . '</div>';
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et

== Changelog ==

= 1.6.11.1 =
- Fixed: Product image schema error in Product schema.

= 1.6.11 =
- Fixed: Improved code quality syntax and security checks for better coding standards and practices.
- Fixed: Recipe - Author type fix.
Expand Down
Loading