• Resolved mc1969

    (@mc1969)


    As far as I can tell from the support documentation (but I could be wrong), it is possible to aggregate all reviews on a certain page, but only stacked vertically, or in some sort of grid formation.

    Is it possible to display a selected number of reviews in a carousel that could be rotated both automatically and also manually if desired (i.e. one click at a time)? If so, what are the shortcode settings I need?

    I would like to display reviews on the front page of a website, but without taking up too much space.

    Alternatively, can anyone suggest another carousel plugin which will work with Site Reviews to get the same result?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Site Reviews does not provide a carousel feature.

    However, Site Reviews does allow you to paginate your reviews (page 1, page 2, etc.) with ajax (without a page reload). So you could display 10 reviews with pagination.

    For a carousel, you will either need to use a carousel/slider plugin that can accept a shortcode as the slide text, or integrate it yourself using the Site Reviews helper functions.

    1. To use the shortcode with a slider plugin:

    Slide #1: [site_reviews count=1]
    Slide #2: [site_reviews count=1 offset=1]
    Slide #3: [site_reviews count=1 offset=2]
    Slide #4: [site_reviews count=1 offset=3]
    etc.

    2. To manually code the carousel yourself:

    // See the Site Reviews "Functions" documentation for more information
    $reviews = apply_filters( 'glsr_get_reviews', [] );
    
    foreach( $reviews as $review ) {
        // Use the $review object to build your slide html.
        // You can use the debug function to print the review object to the page like this:
        apply_filters( 'glsr_debug', null, $review );
    
        // You can render the star rating like this:
        $starsHtml = apply_filters( 'glsr_star_rating', null, $review->rating );
    }
    • This reply was modified 5 years, 5 months ago by Gemini Labs.
    Thread Starter mc1969

    (@mc1969)

    Thank you very much for your prompt reply, and my apologies for not responding sooner.
    The site I am using Site Reviews on has been taking up a lot of my time, and I have only just got round to the reviews section again.

    I opted to use the first of your suggested solutions, and it worked perfectly.

    I have two more questions:

    (1) How do I get a reviewer’s avatar image to show up? I have selected “yes” for both “Enable Avatars” and “Regenerate Avatars” in the Reviews tab in the plugin settings, and I have also submitted a dummy review with a hotmail email address which has the account holder’s image in it’s personal settings.

    However, no image shows up when the review is published.

    (2) The site on which I am using the plugin is a shopping centre site, with a separate page for each tenant. I have set up the plugin on each of these pages (including the page ID in the shortcode) so that tenants can get individual reviews.

    Under “Notifications” in the general settings, I have set my own email address as the default, with a copy also to be sent to the centre managers under “Send To One Or More Email Addresses”.

    Is it possible for an email to be automatically sent at the same time to the individual tenant who receives the review, and if so what is the procedure?

    Plugin Author Gemini Labs

    (@geminilabs)

    1. Site Reviews uses the official WordPress Gravatar implementation for avatars. If the reviewer’s email is associated with a Gravatar account, then the gravatar avatar will be saved to the review and shown. If you enable the “Regenerate Avatars” option, then Site Reviews will fetch a fresh copy of the avatar from gravatar.com on each page load (instead of using the one saved on review submission).

    2. If you need a notification to be sent to a different email address for each tenant, a simple way to do this is to use the Custom Fields metabox to store the tenant email address to the page, then use the code in the link below to dynamically add that email address to the list of notification emails when a review is submitted: https://pastebin.com/q3j37PA2

    For example:

    add_filter( 'site-reviews/notification/emails', function( $emails ) {
        if( $tenantEmail = get_post_meta( get_the_ID(), 'tenant_email', true )) {
            $emails[] = trim( $tenantEmail );
        }
        return array_unique( array_filter( $emails ));
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I Display Reviews In A Carousel?’ is closed to new replies.