Custom query for product reviews
Last updated
Last updated
Bricks Boilerplate offers 2 snippets that you can use to query woocommerce product reviews:
Find the snippet in your account in download area or in the Snippet page (for logged in users only). This snippet will allow you to query all reviews of all products.
Copy the code and Paste it inside Code Snippet plugin or similar, then Activate it.
On any page or template, Add a Div or Block that will act like a list wrapper.
Inside this element add a Div or Block and toggle on the query loop option. Now select query type "All product reviews":
Build your layout and insert dynamic tags.
{brt_product_review_author_name} - get author name
{brt_product_review_date} - review date
{brt_product_review_comment_text} - comment content
{brt_product_review_rating} - show review rating (stars)
{brt_product_review_author_email} - author email
{brt_product_review_author_avatar} - author avatar
{brt_product_review_author_billing_address} - author address (if he/she has account)
{brt_product_review_author_billing_city} - author city
{brt_product_review_author_billing_state} - author state
{brt_product_review_author_billing_country} - author country