Title: Need help with slider shortcode.
Last modified: August 30, 2016

---

# Need help with slider shortcode.

 *  [Ciredor](https://wordpress.org/support/users/ciredor/)
 * (@ciredor)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/need-help-with-slider-shortcode/)
 * What i want to use is slider from Foundation 5 framework (Orbit) as shortcode.
   You can see how it’s work here : [http://foundation.zurb.com/docs/components/orbit.html](http://foundation.zurb.com/docs/components/orbit.html)
 * So far i found some code and after edits got this and it’s working great displaying
   images.
 *     ```
       add_shortcode('orbit', 'orbit_function');
       function orbit_function($atts){
          extract(shortcode_atts(array(
             'ids' => '',
             'size' => 'full',
          ), $atts));
   
       $arr= explode(",",$ids); //prints an array of numbers
   
       echo "<ul id=\"container\" class='example-orbit' data-orbit>\n";
       foreach($arr as $id) {
         $img = wp_get_attachment_image_src($id, $size);
         echo "<li><img src=\"$img[0]\"></li>\n";
       }
         echo "</ul>\n";
       }
       ```
   
 * Now how can i display image caption in orbit ( <div class=”orbit-caption”> caption
   </div>) and if possible image description as content ( <div> description </div
   > ) like on orbit docs.

Viewing 1 replies (of 1 total)

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/need-help-with-slider-shortcode/#post-6460607)
 * do not use ‘echo’ in the shortcode function;
 * [https://codex.wordpress.org/Shortcode_API](https://codex.wordpress.org/Shortcode_API)

Viewing 1 replies (of 1 total)

The topic ‘Need help with slider shortcode.’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/need-help-with-slider-shortcode/#post-6460607)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
