Title: php version of the shortcode
Last modified: December 8, 2017

---

# php version of the shortcode

 *  Resolved [alwilk](https://wordpress.org/support/users/alwilk/)
 * (@alwilk)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-version-of-the-shortcode/)
 * I was wondering whether there is a php version of the shortcode so that I can
   add a php variable for the image id? Or is there a way to insert the php variable
   into the shortcode itself?
 * Basically the variable would be the image id of the uploaded image to the post
 * <?php $awb_image = the_field( ‘hero_image’ ); ?>
 * And I would like this variable to be passed into the shortcode here:
 * <?php echo do_shortcode( ‘[nk_awb awb_type=”image” awb_image=”$awb_image” awb_image_size
   =”full” awb_image_background_size=”cover” awb_image_background_position=”50% 
   50%” awb_parallax=”scroll” awb_parallax_speed=”0.5″]<p>some stuff here</p>[/nk_awb]’);?
   >
 * Although this doesn’t work obviously…
 * Thanks, I really love to plugin and would like to find a way to continue using
   it!

Viewing 1 replies (of 1 total)

 *  Plugin Author [nK](https://wordpress.org/support/users/nko/)
 * (@nko)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/php-version-of-the-shortcode/#post-10088392)
 * Hi.
 * This code should work:
 * `<?php echo do_shortcode('[nk_awb awb_type="image" awb_image="' . $awb_image .'"
   awb_image_size="full" awb_image_background_size="cover" awb_image_background_position
   ="50% 50%" awb_parallax="scroll" awb_parallax_speed="0.5"]<p>some stuff here</
   p>[/nk_awb]'); ?>`
 * p.s. I apologize for a delay in reply, didn’t get any notification about it…

Viewing 1 replies (of 1 total)

The topic ‘php version of the shortcode’ is closed to new replies.

 * ![](https://ps.w.org/advanced-backgrounds/assets/icon-256x256.png?rev=2386996)
 * [Advanced WordPress Backgrounds](https://wordpress.org/plugins/advanced-backgrounds/)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-backgrounds/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-backgrounds/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-backgrounds/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-backgrounds/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [nK](https://wordpress.org/support/users/nko/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/php-version-of-the-shortcode/#post-10088392)
 * Status: resolved