Title: shortcode inside shortcode help
Last modified: August 21, 2016

---

# shortcode inside shortcode help

 *  [mxpimp47](https://wordpress.org/support/users/mxpimp47/)
 * (@mxpimp47)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-inside-shortcode-help/)
 * I am using a jquery script for some images to have a carousel. Testing it using
   divs in the text mode works fine on a page. So I created some shortcodes for 
   the divs so its easier for non html savvy people to use. Only html needed is
 *     ```
       <div class="slider1">
       <div class="slide"><img src.../></div>
       </div>
       ```
   
 * so the shortcodes I created are –
 *     ```
       /** Products */
       function product_shortcode( $atts, $content = null ) {
          return '<div class="slide">'.($content).'</div>';
       }
       add_shortcode('product', 'product_shortcode');
   
       /** scroll wrapper */
       function scroll_shortcode( $atts, $content = null ) {
          return '<div class="slide1">'. do_shortcode($content) .'</div>';
       }
       add_shortcode('scroll', 'scroll_shortcode');
       ```
   
 * But it doesnt work. When typing the html to make it work, the jquery recognizes
   the div class “slider1” and wraps it with other html. And when using the shortcodes
   it renders the div class only.
 * Any suggestions on this? I read this doc – [http://codex.wordpress.org/Function_Reference/do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode)
   but it didnt help.

The topic ‘shortcode inside shortcode help’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [mxpimp47](https://wordpress.org/support/users/mxpimp47/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/shortcode-inside-shortcode-help/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
