Title: get shortcode value into php snippet
Last modified: November 27, 2018

---

# get shortcode value into php snippet

 *  Resolved [janbrokes](https://wordpress.org/support/users/janbrokes/)
 * (@janbrokes)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/get-shortcode-value-into-php-snippet/)
 * Hello i need to add simple math operation. this is code
 *     ```
       $a = 2;
       $b = 8;
   
       echo $a / $b *100;
       ```
   
 * but i need to add there vaues of shortcode like
 *     ```
       $a = <?php echo do_shortcode('[name_of_shortcode]'); ?>
       $b = <?php echo do_shortcode('[name_of_shortcode2]'); ?>
       ```
   
 * but this does not work. Could you please help me find correct way?
 * Thanks in advance

Viewing 1 replies (of 1 total)

 *  [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * (@davdebcom)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/get-shortcode-value-into-php-snippet/#post-10968977)
 * Hi
 * I’m sorry, this isn’t possible with Post Snippets.
 * Kind regards
    David

Viewing 1 replies (of 1 total)

The topic ‘get shortcode value into php snippet’ is closed to new replies.

 * ![](https://ps.w.org/post-snippets/assets/icon-128x128.gif?rev=2545587)
 * [Post Snippets - Custom WordPress Code Snippets Customizer](https://wordpress.org/plugins/post-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/post-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-snippets/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/get-shortcode-value-into-php-snippet/#post-10968977)
 * Status: resolved