• Resolved wuppie

    (@wuppie)


    Hi there,

    First of all i love your plugin!

    I have one question though:
    When a user submits a review on a custom post (in this case a hotel) i would like to display the post featured image with the review, so that other users can see the hotel the user reviewed.

    Is this a existing function? Or how can i achieve this?

    Looking forward hearing from you and thanks in advance!

    Kind regards,
    Wuppie

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

    (@geminilabs)

    Sort of.

    If you enable the “Enable Assigned Links” option in the plugin settings and assign reviews automatically to a page, the reviews will each show a link to the page they are assigned to.

    1. Enable the “Enable Assigned Links”

    2. Assign reviews to the current page

    3. All done!

    Thread Starter wuppie

    (@wuppie)

    Hi there,

    Thank you for getting back to me so quickly.
    I used the settings above but unfortunately the post featured image is not shown in the user review?

    Plugin Author Gemini Labs

    (@geminilabs)

    Site Reviews does not offer that feature (i.e. showing the featured image of the assigned post).

    However, you can add this yourself: https://pastebin.com/tLktdxYu

    After adding the code in the link above by using the Code Snippets plugin, or by adding it directly to your theme’s functions.php file, you can use the “assigned_to_image” in the “review.php” template like this:

    <div class="glsr-review">
        {{ assigned_to_image }}
        ...
    </div>

    Please read the documentation which explains how to use a custom review template in your theme:

    • This reply was modified 5 years, 11 months ago by Gemini Labs.
    Thread Starter wuppie

    (@wuppie)

    Great! That did the trick!

    Thank you very much.

    One other question:
    How do i display ALL reviews inside a page template?

    Thanks in advance!

    Plugin Author Gemini Labs

    (@geminilabs)

    This is not recommended, what if you get hundreds of reviews? The page will take longer to load each time a new review is added.

    Instead, use the pagination option. For example, to show 25 reviews per-page:

    [site_reviews count=25 pagination=ajax]

    Hello. Adding in this code did not add a featured image section for each review for me. Any other ideas or reason it wouldn’t show up? And when I added {{ assigned_to_image }} to the review.php file, it displayed the featured image from the Page which has the shortcode [site_views]

    Thank you!

    Plugin Author Gemini Labs

    (@geminilabs)

    @dperis

    This code does not add a field to the submission form which allows you to add a featured image for each review. Site Reviews does not offer image support for reviews.

    This code, as requested by @wuppie, simply adds a new tag to use in the review template which allows you to display the featured image of the assigned page or post to the review.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show post featured image with review’ is closed to new replies.