Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Created February 18, 2014 13:52
Show Gist options
  • Save thomasgriffin/9071378 to your computer and use it in GitHub Desktop.
Save thomasgriffin/9071378 to your computer and use it in GitHub Desktop.
Remove width and height attributes from images in Soliloquy sliders.
<?php
add_action( 'tgmsp_callback_start', 'tgm_soliloquy_remove_image_attr' );
function tgm_soliloquy_remove_image_attr( $id ) {
$script = 'var slides = $(slider).find(".soliloquy-slides > li img");';
$script .= '$(slides).each(function(i){';
$script .= '$(this).removeAttr("width height");';
$script .= '});';
echo $script;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment