diff --git a/wp-postratings.php b/wp-postratings.php index 36d3d39..352e362 100644 --- a/wp-postratings.php +++ b/wp-postratings.php @@ -1163,7 +1163,11 @@ function expand_ratings_template($template, $post_data, $post_ratings_data = nul // Post Template Variables $post_link = get_permalink( $post_data ); - $post_title = get_the_title( $post_data ); + if ((get_post_meta($post_id, '_yoast_wpseo_title', true)) == “”) { + $post_title = get_the_title($post_data); + } else { + $post_title = get_post_meta($post_id, '_yoast_wpseo_title', true); + } if ( $max_post_title_chars > 0 ) { $post_title = snippet_text( $post_title, $max_post_title_chars ); } @@ -1196,6 +1200,10 @@ function expand_ratings_template($template, $post_data, $post_ratings_data = nul } $value = str_replace( '%POST_THUMBNAIL%', get_the_post_thumbnail( $post, 'thumbnail' ), $value ); } + + if (get_post_meta($post_id, '_yoast_wpseo_metadesc', true) <> “”) { + $post_excerpt = get_post_meta($post_id, '_yoast_wpseo_metadesc', true); + } // Google Rich Snippet $google_structured_data = '';