SVG/PNG extension switch
Is there a way to use SVG images on my site and if browsers/devices do not support it, switch the extension to png? Is there a better way to do this? Note: I am using the <img> tag and Modernizr. Here is my code that spits out the images dynamically. <?php $attachments = attachments_get_attachments(); ?> <?php if( function_exists( 'attachments_get_attachments' ) ) { $attachments = attachments_get_attachments(); $total_attachments = count( $attachments ); if( $total_attachments ) : ?><?php for( $i=0; $i<$total_attachments; $i++ ) : ?> <img src="<?php echo $attachments[$i]['location']; ?>" alt="