I currently have some php code which gets the thumbnail of random Wordpress posts but the problem is when I run it none of the images show until every image has been downloaded. I was wondering if there is a way to echo the image then go to the next one. Thanks.
<?php
$args = array( 'numberposts' => 25, 'orderby' => 'rand' );
$rand_posts = get_posts( $args );
foreach( $rand_posts as $post ) : ?>
<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );?>
<li id="photo-<?php the_ID(); ?>" class="visible scroll-content-item ui-widget-header"><a href="<?php the_permalink(); ?>"><img width="80" height="80" src="<?php echo $url; ?>" class="attachment-small-grid wp-post-image" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /></a> </li>
<?php endforeach; ?>