| | |
| | | if ($inheritUser) { |
| | | global $post; |
| | | $inheritUser = $post->post_author; |
| | | }else { |
| | | $inheritUser = null; |
| | | } |
| | | try { |
| | | $gmb = JVB()->connect('gmb', $inheritUser); |
| | |
| | | ob_start(); |
| | | ?> |
| | | <div class="gmb-reviews"> |
| | | <div class="row btw"> |
| | | <div class="row x-mid"> |
| | | <?php |
| | | if ($showStats && !empty($average) && !empty($total)) { |
| | | ?> |
| | | <p> |
| | | <span class="stars" aria-label="<?= $average ?> out of 5 stars"> |
| | | <span class="stars" title="<?= $average ?> out of 5 stars"> |
| | | <?php |
| | | $fullStars = floor($average); |
| | | $hasHalfStar = ($average - $fullStars) >= 0.5; |
| | |
| | | } |
| | | ?> |
| | | |
| | | |
| | | </div> |
| | | <?php |
| | | if ($showReviewLink && !empty($reviewUrl)) { |
| | | ?> |
| | | <a href="<?=esc_url($reviewUrl)?>" |
| | | class="button" |
| | | target="_blank" |
| | | rel="noopener noreferrer"> |
| | | class="btn" |
| | | target="_blank" |
| | | rel="noopener noreferrer"> |
| | | <?= jvbIcon('star', ['style' => 'fill']) ?> |
| | | Leave Your Review |
| | | </a> |
| | | <?php |
| | | } |
| | | ?> |
| | | </div> |
| | | |
| | | <ul> |
| | | <?php |
| | |
| | | <li> |
| | | <blockquote class="review"> |
| | | <?php |
| | | echo jvbIcon('quotes',['style' => 'fill']); |
| | | // Review text |
| | | if (!empty($comment)) { ?> |
| | | <div class="content review"> |
| | | <?= apply_filters('wpautop', $comment) ?> |
| | | </div> |
| | | <?php } ?> |
| | | <cite class="row start nowrap"> |
| | | <cite class="row left nowrap"> |
| | | <?php if (!empty($profilePhoto)) { ?> |
| | | <img src="<?=esc_url($profilePhoto)?>" |
| | | alt="<?=esc_attr($reviewer)?>" |
| | |
| | | </div> |
| | | <?php } ?> |
| | | |
| | | <div class="row start wrap"> |
| | | <div class="row left wrap"> |
| | | <?php if ($showRating && $rating > 0) { ?> |
| | | <div class="stars" title="<?= $rating ?> out of 5 stars"> |
| | | <?php |
| | | for ($i = 1; $i <= 5; $i++) { |
| | | echo ($i <= $rating) ? jvbIcon('star', ['style' => 'fill']) : jvbIcon('star', ['style' => 'light']); |
| | | } ?> |
| | | </div> |
| | | <?php } ?> |
| | | <p><?= esc_html($reviewer)?></p> |
| | | <?php |
| | | // Date |
| | |
| | | <?= esc_html($formatted_date) ?> |
| | | </time> |
| | | <?php } ?> |
| | | <?php if ($showRating && $rating > 0) { ?> |
| | | <div class="stars" aria-label="<?= $rating ?> out of 5 stars"> |
| | | <?php |
| | | for ($i = 1; $i <= 5; $i++) { |
| | | echo ($i <= $rating) ? jvbIcon('star', ['style' => 'fill']) : jvbIcon('star', ['style' => 'light']); |
| | | } ?> |
| | | </div> |
| | | <?php } ?> |
| | | |
| | | </div> |
| | | </cite> |
| | | </blockquote> |
| | |
| | | ?> |
| | | <div class="footer"> |
| | | <a href=" <?= esc_url($viewAllUrl) ?>" |
| | | class="button" |
| | | class="btn" |
| | | target="_blank" |
| | | rel="noopener noreferrer"> |
| | | |