Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * WordPress shortcode for Spoiled Slideshow
- * http://spoiledmilk.dk/demos/spoiled-slideshow/
- * usage: [sspoiled imgs="http://aa.com/aa.jpg,http://bb.com/bb.jpg,http://cc.com/cc.jpg" width="600" height="300"]
- * by brasofilo
- */
- function se49804_shortcode ($atts, $content = null) {
- $imgs = explode( ',', $atts['imgs'] );
- $width = $atts['width'];
- $height = $atts['height'];
- $imgList = '';
- foreach($imgs as $img) {
- $imgList .= "\t\t" . '<img src="'.$img.'" width="'.$width.'" height="'.$height.'" alt="" class="slide current" />' . "\r\n";
- }
- $html = <<<HTML
- <!--slideshow-->
- <div class="slideshow">
- <div class="slides">
- $imgList
- </div>
- <div class="controls">
- <a href="#" class="previous">
- <span class="arrow">←</span> Prev
- </a>
- <div class="state"></div>
- <a href="#" class="next">
- <span class="arrow">→</span> Next
- </a>
- </div>
- </div>
- <!--end slideshow-->
- HTML;
- return $html;
- }
- add_shortcode('sspoiled', 'se49804_shortcode');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement