• Resolved bartdenhartog

    (@bartdenhartog)


    Hi,

    Question; the website displays a 502 Bad Gateway after updating the plugin. The code below gives the error:

    $review = apply_filters( ‘glsr_get_review’, null, $post->ID );
    $reviewHtml = $review->build();

    <div class="row">
                <?php 
                    $args = [
                        'post_type' => 'site-review',
                        'posts_per_page' => -1,   
                    ];
                    $loop = new WP_Query($args);
                    while ($loop->have_posts()) {
                    $loop->the_post();
                    $review = apply_filters( 'glsr_get_review', null, $post->ID );
                    $reviewHtml = $review->build();
                ?>
    
                    <div class="col-12 col-sm-12 col-md-6 col-lg-4">
                        <div class="review__item">
                            <?php echo $reviewHtml->rating; ?>
                            <p>"<?php echo $review->content; ?>"</p>
                            <span>- <?php echo $review->author; ?></span>
                        </div>
                    </div>
                <?php
                } ?>
            </div>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Are you running PHP 7.4?

    This will be fixed in the next update. However, you can also do this instead:

    <div class="review__item">
        <?= apply_filters('glsr_star_rating', null, $review->rating); ?>
        <?= wpautop($review->content); ?>
        <span>- <?= $review->author; ?></span>
    </div>

    OR, you use custom templates in your theme to do the exact same thing (see “How do I use the plugin templates in my theme?” section on the Help > FAQ page):

    reviews.php

    <div class="glsr-reviews-wrap">
        <div class="row {{ class }}" id="{{ id }}">
            {{ reviews }}
        </div>
        {{ pagination }}
    </div>

    review.php

    <div class="col-12 col-sm-12 col-md-6 col-lg-4">
        <div class="glsr-review review__item">
            {{ title }}
            {{ rating }}
            {{ date }}
            {{ assigned_to }}
            {{ content }}
            {{ avatar }}
            {{ author }}
            {{ response }}
        </div>
    </div>
    Thread Starter bartdenhartog

    (@bartdenhartog)

    The website runs on PHP 7.3.13.

    The first fix worked for me. when can I expect the update?

    Plugin Author Gemini Labs

    (@geminilabs)

    It will be released sometime this week. Although, since you are using your own HTML to wrap the review values, you shouldn’t really need the HTML fields so it won’t affect you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘502 Bad Gateway’ is closed to new replies.