Save up to 25% on pro security plugins w/ our Security Bundle »
Web Dev + WordPress + Security
GA Google Analytics Pro
GA Pro: Add Google Analytics to WordPress like a pro.

Slideshow Code for Dead Letter Art

[ Icon: DLa Joker ] Pardon this post! I am posting this information online for personal references purposes. I may need to revisit this code at some point in the future, and if I post it here I will always know where to find it (trust me, it would disappear into the abyss if I tried storing it offline). So, although it is intended solely for myself, feel free to extract and use anything you like, as long as commented attribution remains. What we have here are two different methods for including a slideshow on a web page. The first method employs the techniques discussed in this article, while the second method skips the Flash and employs only the JavaScript portion of the slideshow. Here is some additional help with embedding Flash content, including slideshows, and JavaScript techniques.

Main Slideshow

<?php // main slideshow // ?>
<div class="midright">
<!-- slideshow inclusion by perishablepress.com -->
<script type="text/javascript">
<!--//--><![CDATA[//><!-- 
if (flash.ver[7]) {
   document.write(
      '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="300" height="225" id="slideshow" align="middle">' +
      '<param name="movie" value="http://deadletterart.com/dla/images/slideshow/slideshow.swf" />' +
      '<param name="allowScriptAccess" value="sameDomain" />' +
      '<param name="quality" value="high" />' +
      '<param name="bgcolor" value="#000" />' +
      '<param name="base" value="." />' +
      '<embed src="http://deadletterart.com/dla/images/slideshow/slideshow.swf" base="." quality="high" bgcolor="#000" width="300" height="225" name="slideshow" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
      '<\/object>'
   );
}
else if (flash.installed) {
   document.write('<form id="slideshow" name="slideshow" action="null"><a href="#" onmouseover="this.href=theimage[i][1];return false">');
   document.write('<img name="imgslide" class="y" id="imgslide" src="' + theimage[0][0] + '" border="0" alt="DLa Slideshow" />');
   document.write('<\/a><\/form>');
} else {
   document.write('<form id="slideshow" name="slideshow" action="null"><a href="#" onmouseover="this.href=theimage[i][1];return false">');
   document.write('<img name="imgslide" class="y" id="imgslide" src="' + theimage[0][0] + '" border="0" alt="DLa Slideshow" />');
   document.write('<\/a><\/form>');
}
//--><!]]>
</script>
<noscript><div><img src="http://deadletterart.com/dla/images/slideshow/1.jpg" class="y" alt="Serious Business" /></div></noscript>
</div>

Alternate Slideshow

<?php // alt slideshow // ?>
<div class="midright">
 <!-- slideshow inclusion by perishablepress.com -->
 <form id="slideshow" name="slideshow" action="null">
  <div>
   <a href="#" onmouseover="this.href=theimage[i][1];return false">
    <script type="text/javascript">
     <!--//--><![CDATA[//><!--
      document.write('<img name="imgslide" class="y" id="imgslide" src="'+theimage[0][0]+'" border="0" alt="DLa Slideshow" />');
     //--><!]]>
    </script>
   </a>
  </div>
  <noscript>
   <p><img src="http://deadletterart.com/dla/images/slideshow/1.jpg" class="y" alt="Serious Business" /></p>
  </noscript>
 </form>
</div>

More sweet code snippets on the way..

Jeff Starr
About the Author
Jeff Starr = Designer. Developer. Producer. Writer. Editor. Etc.
Blackhole Pro: Trap bad bots in a virtual black hole.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
The Tao of WordPress: Master the art of WordPress.
Thoughts
Fall season almost here :)
My greatest skill on social media is the ability to simply ignore 98% and keep scrolling without interacting.
Enjoying this summer, getting some great positive energy. Refreshing and inspiring.
☀️ Pro plugin giveaway! Enter to win 1 of 4 lifetime licenses for our WordPress security plugins, including 10-site Security Bundle!
There is no end to what humans can achieve when they work together.
Excellent (and free) tool to test your site's SSL configuration.
Plugin updates! All of our free and pro plugins ready for WordPress 6.2.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.