Not sure if anyone is interested, but I modified the rotating_images.php template in order to remove the multiple switch cases and IMG tags.
You can
see this in action on my blog. Let me know what you think.
Thanks,
Claude
PHP Code:
<?php
// This template is a modification to Chris Pearson's original rotating_images.php part of his Thesis theme for Wordpress.
// Modifications by Claude Betancourt, cbetancourt@gmail.com
// INSTRUCTIONS:
// For best results, you should upload images that have common aspect ratios, such as: (Width x Height)
// 4:3 — no additional class required (although you can use class="four_by_three" if you like) (420 x 315)
// 3:2 — apply class="three_by_two" to the appropriate image declaration below (420 x 280)
// 16:9 — apply class="sixteen_by_nine" to the appropriate image declaration below (420 x 236)
// Modify this to a relative path, not necessarily inside the theme folder
$imagePath = '/images/blog/headers/';
// Create an empty array for our images
$images = array();
// Repeat this block for each of your images
// while being careful to add the image file name, title (alt text) and aspect ratio class.
$images[count($images)] = array(
'imageName' => 'candles.jpg',
'title' => 'Candles',
'className' => ''
);
$images[count($images)] = array(
'imageName' => 'emmy.jpg',
'title' => 'Emmy',
'className' => 'sixteen_by_nine'
);
$images[count($images)] = array(
'imageName' => 'emmy-aota.jpg',
'title' => 'Emmy\'s Celebration of the Arts',
'className' => 'sixteen_by_nine'
);
$images[count($images)] = array(
'imageName' => 'harley.jpg',
'title' => 'Harley',
'className' => 'sixteen_by_nine'
);
$images[count($images)] = array(
'imageName' => 'hot-air-balloon.jpg',
'title' => 'Hot Air Balloon',
'className' => 'sixteen_by_nine'
);
$images[count($images)] = array(
'imageName' => 'park.jpg',
'title' => 'Park',
'className' => 'sixteen_by_nine'
);
$images[count($images)] = array(
'imageName' => 'sarah.jpg',
'title' => 'Sarah',
'className' => 'sixteen_by_nine'
);
$images[count($images)] = array(
'imageName' => 'tulip.jpg',
'title' => 'Sarah\'s Tulips, 2008',
'className' => 'sixteen_by_nine'
);
// There is no need to modify the following lines
$key = rand(0,count($images)-1);
$imageName = $images[$key]['imageName'];
$imageTitle = $images[$key]['title'];
$imageClass = $images[$key]['className'];
?>
<img class="<?php echo $imageClass ?>" src="<?php echo $imagePath ?><?php echo $imageName ?>" alt="<?php echo $imageTitle ?>" title="<?php echo $imageTitle ?>" />