View Single Post
Old 08-10-2010, 08:29 AM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
Quote:
Originally Posted by The Dawg View Post
Thanks, this may do it.


Doesnt matter, it could be a file folder, a plugin or whatever. I just want it to scroll through 3 or 4 images. FCG is attached to an article and thats not really what I want.
If you want to do it via folder, here is something i would go about doing.

in your template you would do <?php custom_slideshow_image_list();?>

and have the slider code above or below that, the part where it sets the div, jquery, etc

Code:
    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;
    }
hope this helps (images/slideshow) being the directory inside your theme dir.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote