Shortcodes

Visit this tutorial video and read the detail written documentation below:

 

The plugin provides with 4 shortcodes.

 

A. The shortcode to display reviews.

Reviews shortcode is used to display all reviews or specific reviews of some products or categories. Usage with all available arguments:

[wc_photo_reviews_shortcode comments_per_page="12" cols="3" cols_mobile="1" use_single_product="on" cols_gap="" products="" grid_bg_color="" grid_item_bg_color="" grid_item_border_color="" text_color="" star_color="" product_cat="" order="" orderby="comment_date_gmt" show_product="on" filter="on" pagination="on" pagination_ajax="on" pagination_pre="" pagination_next="" loadmore_button="off" filter_default_image="off" filter_default_verified="off" filter_default_rating="" pagination_position="" conditional_tag="" custom_css="" ratings="" mobile="on" is_slide="on" style="masonry" masonry_popup="review" enable_box_shadow="on" full_screen_mobile="on" overall_rating="off" rating_count="off" only_images="off" image_popup="below_thumb"]

General

  • comments_per_page: number of comments per page. comments_per_page='12'
  • mobile: ON/OFF, select if you want the shortcode to run on mobile devices. Example: mobile='on'
  • use_single_product: ON/OFF – Enable/disable to show reviews of a single product. E.g. You place this shortcode under a single product page and choose “ON”, it displays reviews of that product only; otherwise it displays reviews of all products. Example:use_single_product='on'
  • products: display reviews of which products, enter product IDs. Example:  products='99,100'
  • product_cat: display reviews of products in which category.  Use the category ID for this shortcode. Example: 16 is the category ID of a specific ID:product_cat='16'
  • order: sort reviews ASC or DESC. Example: order='asc'
  • orderby: select how you would like to sort reviews. ‘comment_author’, ‘comment_date’, ‘comment_ID’, ‘comment_post_ID’, ‘wcpr_review_vote’. Example: orderby='comment_ID'
  • If to sort reviews by vote, use this shortcode: orderby='wcpr_review_vote'
  • conditional_tag: enter conditional tags to select pages you want to display the review. In case you paste the shortcode in an area that appears on many pages, use this option to select which pages you want the shortcode to run. Example: conditional_tag='is_page(35)'
    Important note:
    To handle WP’s Conditional Tags, this plugin uses eval() which is very dangerous because it allows execution of arbitrary PHP code. Therefore, please only fill this field with proper conditional tags which are validated and/or provided by trusted developers.
  • ratings: select which rating you want to display. Example: display only 4 and 5 stars reviews, ratings='4,5'
  • only_images: ON/OFF select if you want to display only reviews that have images. Example: only_images='on'

Pagination

  • pagination: turn pagination ON/OFF. Example:pagination='on'
  • pagination_ajax: do not reload the page when customers select another review page or select a filter. Example pagination_ajax='on'
  • pagination_position: select left/right/center. Example: pagination_position='center'
  • pagination_pre and  pagination_next: allows to show the Next and Previous button to redirect to next/previous review pages. Example: pagination_pre="Pre" and pagination_next="Next"
  • loadmore_button: allow to load next reviews by clicking the Load more button, use ON/OFF  to turn on or turn off this feature. Example: loadmore_button="on"

Filter

  • filter: show filter bar, ON/OFF. Example:filter='on'
  • filter_default_image: Select Image filter by default, ON/OFF. Example filter_default_image='on'
  • filter_default_verified: Select verified filter by default, ON/OFF. Example filter_default_verified='on'
  • filter_default_rating: Select rating filter by default. Example filter_default_rating='5'

Rating count

  • rating_count: ON/OFF select if you want to display the rating count module. Example:rating_count='on'
  • overall_rating: ON/OFF select if you want to display the overall rating. Example: overall_rating='on'

Design

  • display as slider: Display reviews in the shortcode under a slider, ON/OFF. Example: is_slide="on"
  • style: select the front-end style masonry/normal. Example:style='masonry
  •  masonry_popup: display the masonry popup, you can choose review or image. Example:masonry_popup='review'
  • cols: number of grid columns. Example:  cols='3'
  • cols_mobile: number of columns on mobile. Example: cols_mobile='1'
  • cols_gap: gap between grid columns(px). Example:cols_gap='30'
  • grid_bg_color: grid background color. Example:  grid_bg_color='#000000'
  • grid_item_bg_color: grid item background color. Example: grid_item_bg_color='#3c3c3c'
  • grid_item_border_color: Grid item border color. Example: grid_item_border_color='Gold'
  • text_color: reviews text color. Example: text_color="'#ffffff'
  • verified_badge_color: verified badge color. Example: verified_badge_color='#29D50B'
  • star_color: rating stars color. Example: star_color='yellow'
  • show_product: show product summary on Masonry popup, ON/OFF. Example: show_product='on'
  • full_screen_mobile: Select to enable full screen on mobile, ON/OFF. Example: full_screen_mobile='on'
  • image_popup: Display the image popup, you can choose below thumb or light box. Example:image_popup='below_thumb'
  • enable_box_shadow: Select to enable box-shadow, ON/OFF. Example: enable_box_shadow='on'
  • custom_css: allows you to add your custom CSS code. Example: custom_css='.star-rating:before,.star-rating>span{top: 0;}'

Language

  • If you’re using WPML and want to show reviews in all languages, add this argument to the shortcode, ON/OFF: wpml_all_languages="on"
  • If you’re using Polylang and want to show reviews in all languages, add this argument instead, ON/OFF: pll_all_languages="on"

 

Note: The filters and/or the overall rating will be hidden if there’s no review to filter/to show the overall rating.

 

B. The shortcode to display the reviews form.

[woocommerce_photo_reviews_form product_id='85' hide_product_details='on' hide_product_price='on' type='popup' button_position='left']

This shortcode helps you to display a review form. There are 3 ways to use it.

  • Display in single product pages: Paste the shortcode [woocommerce_photo_reviews_form] into the product description to display a review form for that product on the front-end.
  • Add product ID: Add a product ID into the shortcode [woocommerce_photo_reviews_form product_id='85'] by adding the product ID you can create a review form for a specific product and display it on any page.
  • hide_product_details: ON/OFF Allow you to hide or show product details. Example if you want to hide product detail: [woocommerce_photo_reviews_form product_id='85' hide_product_details='on']
  • hide_product_price: ON/OFF Allow you to hide or show the product price. Example if you want to hide product price: [woocommerce_photo_reviews_form product_id='85' hide_product_price='on']
  • type: POPUP or empty Allow you to show review form popup type or not. Example: [woocommerce_photo_reviews_form product_id='85' type='popup']
  • button_position: LEFT/RIGHT/CENTER Allow to show review form button position, left, center, or right. Example: [woocommerce_photo_reviews_form product_id='85' type='popup' button_position='left']
  • Create a review page: Use the shortcode [woocommerce_photo_reviews_form] to create a review page, then add the review page in the Review Reminder tab. Customers who click on the Review now button in the Review Reminder email will be redirected to this page.

C. The shortcode to display review overall rating.

[wc_photo_reviews_overall_rating_html product_id="" overall_rating_enable="on" rating_count_enable="on"]

The review overall rating shortcode allows displaying the overall rating of reviews of a product anywhere you want. Usage with all available options:

  • product_id: display reviews of which products, enter product IDs. Leave empty if you insert this shortcode on a product page, so overall reviews will be of that product. Example:  products='99,100'
  • overall_rating_enable: ON/OFF, select if you want to display overall rating, just leave ON. For example: overall_rating_enable="on"
  • rating_count_enable: ON/OFF, select if you want to display overall rating, just leave ON. For example: rating_count_enable="on"

 

D. The shortcode to display product rating

[wc_photo_reviews_rating_html product_id="" rating="" review_count="on"]

This shortcode is used to display the rating of a product(s)

  • product_id: display rating of which products, enter product IDs. Leave empty if you insert this shortcode on a product page, so product rating will be of that product. Example:  products='99,100'
  • rating: Display a specific rating in the rank from 1 -5 star.
  • review_count: ON/OFF to display the rating count.