• Resolved James Hunt

    (@bonkerz)


    I have a weird issue with this plugin not working via do_shortcode and I wonder if you can help.

    I have the ISBN as part of ACF, and I am calling that in PHP – I echo it and it displays the correct ISBN, but when I insert it as a variable inside the do_shortcode, it fails to display. Any ideas why that is? Other plugins using this method work fine, just not Good Reviews ??

    
    <?php
    $isbn_number = the_field('isbn');
    echo $isbn_number;
    echo do_shortcode('[goodreviews buyinfo="off" bookinfo="on" author="large" cover="large" grbackground="000" grtext="fff" height="500" width="500" border="off" isbn="' . $isbn_number . '"]');
    ?>

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter James Hunt

    (@bonkerz)

    Meh, I played around with the ‘ and the ” and got it working! ??

    <?php
    $isbn_number = get_field('isbn');
    echo do_shortcode('[goodreviews isbn="' .$isbn_number. '" buyinfo="off" bookinfo="on" author="large" cover="large" grbackground="000" grtext="fff" border="off"]');
    ?>
    Plugin Author jhanbackjr

    (@jhanbackjr)

    Hi, bonkerz!

    Thanks for using GoodReviews, and thanks for letting me know. I was just sitting down to take a look at the issue!

    James

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using in PHP Shortcode not working’ is closed to new replies.