Hello,
Sorry for the late reply.
If you want to show review box on single post in custom place, please try to use this:
echo wp_review_get_data();
Hope that helps.
Thank you.
-
This reply was modified 9 years, 6 months ago by
MyThemeShop.
Hi, I want to integrate WP review in my theme custom position using [wp-review id]
but I want it with some logic like this, because If I set it “No Review”
<?php
$post_id = get_the_ID();
if(isset( Which function/parameter should I use here? )){
echo do_shortcode(“[wp-review id=\”{$post_id}\”]”);
}
else{
echo “No reviews available”;
}
?>
Hello,
You could use wp_review_get_post_review_type( $post_id ):
<?php
$post_id = get_the_ID();
if ( ! empty( wp_review_get_post_review_type( $post_id ) ) {
echo do_shortcode('[wp-review id="' . $post_id . '"]');
} else {
echo 'No reviews available.';
}
-
This reply was modified 9 years, 5 months ago by
MyThemeShop.
Thanks a lot 🙂
It’s working.
One closing parenthesis is missing on code. It should be –
<?php
$post_id = get_the_ID();
if ( ! empty( wp_review_get_post_review_type( $post_id ) ) ) {
echo do_shortcode('[wp-review id="' . $post_id . '"]');
} else {
echo 'No reviews available.';
}