• Resolved baracoda

    (@baracoda)


    hello !
    i want to integrate wp review in my theme so i can show it in a custom position. can you provide the right function ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author MyThemeShop

    (@mythemeshop)

    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”;
    }
    ?>

    Plugin Author MyThemeShop

    (@mythemeshop)

    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.';
    }
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Integration in Theme’ is closed to new replies.