• 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

    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)
Viewing 1 replies (of 1 total)

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