メニュー 閉じる

Googleレビューを複数サイトで表示

まず、プラグインでレビューが表示できるようにインストール。
ルートに「sc_google_reviews.php」を作成、このページを各サイトにインラインフレームで表示する。
実際のURLは「https://medicom-toy.akafujiya.com/sc_google_reviews.php」

「sc_google_reviews.php」の中身。

<?php require_once('wp-load.php'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="https://medicom-toy.akafujiya.com/wp-content/plugins/widget-google-reviews/assets/css/public-main.css?ver=2.6">
<script src="https://medicom-toy.akafujiya.com/wp-content/plugins/widget-google-reviews/assets/js/admin-apexcharts.js" type="text/javascript"></script>
<script src="https://medicom-toy.akafujiya.com/wp-content/plugins/widget-google-reviews/assets/js/admin-main.js" type="text/javascript"></script>
<script src="https://medicom-toy.akafujiya.com/wp-content/plugins/widget-google-reviews/assets/js/public-main.js" type="text/javascript"></script>
<title>レビュー</title>
</head>

<body>

<?php echo do_shortcode('[grw id="12382"]'); ?>

</body>
</html>

インラインフレームで任意の場所に読み込む

<div class="greview">
<iframe src="https://medicom-toy.akafujiya.com/sc_google_reviews.php"style="width: 100%; height: 300px;" allowfullscreen class="review_frame"></iframe>
</div>

スマホ用にスタイル調整

iframe.review_frame{
height:480px!important;
}