Title: Using in PHP Shortcode not working
Last modified: January 21, 2017

---

# Using in PHP Shortcode not working

 *  Resolved [James Hunt](https://wordpress.org/support/users/bonkerz/)
 * (@bonkerz)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/using-in-php-shortcode-not-working/)
 * 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](https://wordpress.org/support/users/bonkerz/)
 * (@bonkerz)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/using-in-php-shortcode-not-working/#post-8682105)
 * 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](https://wordpress.org/support/users/jhanbackjr/)
 * (@jhanbackjr)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/using-in-php-shortcode-not-working/#post-8682127)
 * 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.

 * ![](https://ps.w.org/goodreviews/assets/icon-256x256.png?rev=973707)
 * [GoodReviews](https://wordpress.org/plugins/goodreviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/goodreviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/goodreviews/)
 * [Active Topics](https://wordpress.org/support/plugin/goodreviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/goodreviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/goodreviews/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 2 replies
 * 2 participants
 * Last reply from: [jhanbackjr](https://wordpress.org/support/users/jhanbackjr/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/using-in-php-shortcode-not-working/#post-8682127)
 * Status: resolved