I want to insert a slideshow of pictures to the index of my blog, but I dont need them attached to any articles.
Whats the easiest solution to do this?
Thanks
Whats the easiest solution to do this?
Thanks
function custom_slideshow_image_list()
{
$path = sprintf( '%s/images/slideshow/', TEMPLATEPATH );
$url = sprintf( '%s/images/slideshow/', get_bloginfo( 'template_directory' ) );
$file_types = array( '*.jpg', '*.png', '*.gif' );
$images = array();
foreach( $file_types as $file_type )
foreach( glob( $path . $file_type ) as $file )
$images[ $file ] = $url . basename( $file );
$output = "<ul id=\"slideshow\">\n\t";
foreach( $images as $i )
$output .= sprintf( "\t<li><img src=\"%s\" alt=\"%s\" /></li>\n\t", $i, basename( $i ) );
$output .= "</ul>\n";
echo $output;
}

Comment