Title: Problem of shortcode in theme
Last modified: November 9, 2018

---

# Problem of shortcode in theme

 *  Resolved [reza2511](https://wordpress.org/support/users/reza2511/)
 * (@reza2511)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/problem-of-shortcode-in-theme/)
 * Hi everybody,
 * I am using a template which doesn’t accept the shortcode of [wpsm_comparison_table
   id=”1″]
    Actually, this template has a problem with spacing in the shortcodes.
   For example the space between _table and id=1. Once I put the mentioned shortcode
   like `<?php echo do_shortcode("[wpsm_comparison_table id="1" class=""]"); ?>`
   in the template, I cannot load the website. Please kindly help me with this issue.
 * Regards,
    -  This topic was modified 7 years, 6 months ago by [reza2511](https://wordpress.org/support/users/reza2511/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Jacob Peattie](https://wordpress.org/support/users/jakept/)
 * (@jakept)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/problem-of-shortcode-in-theme/#post-10864151)
 * You’re mixing up quotes in a way that isn’t valid PHP. If you write `do_shortcode()`
   like this:
 *     ```
       do_shortcode( "" );
       ```
   
 * Then whatever is inside the quotes, `""`, will be parsed for shortcodes. But 
   if you write the shortcode like this:
 *     ```
       [wpsm_comparison_table id="1" class=""]
       ```
   
 * Then the first `"` will close the quotes inside `do_shortcode()`, breaking the
   code.
 * You need to use different quotes for each part. Use single quotes for the `do_shortcode()`
   function, and double quotes for the shortcode:
 *     ```
       do_shortcode( '[wpsm_comparison_table id="1" class=""]' );
       ```
   
 * See the article on [Strings](http://php.net/manual/en/language.types.string.php)
   in the PHP Manual for more information.
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [7 years, 6 months ago](https://wordpress.org/support/topic/problem-of-shortcode-in-theme/#post-10867021)
 * What do you mean by:
 * > I am using a template which doesn’t accept the shortcode
 * What theme is it?
 * ps. I recommend moving away from a theme that uses shortcodes because that will
   make it a little harder to switch themes down the road.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem of shortcode in theme’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/problem-of-shortcode-in-theme/#post-10867021)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
