Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Last active December 24, 2015 10:19
Show Gist options
  • Save clifgriffin/6783559 to your computer and use it in GitHub Desktop.
Save clifgriffin/6783559 to your computer and use it in GitHub Desktop.
Making WooSlider and Shopp play nicely together.
<?php
add_filter('wooslider_get_slides', 'shopp_wooslider', 10, 4);
public function shopp_wooslider($slides, $type, $args, $settings) {
if( is_shopp_product() ) {
$slides = array();
if ( shopp('product', 'has-images') ) {
while( shopp('product','images') ) {
$data = array( 'content' => shopp('product','get-image',"setting={$args['size']}") );
$slides[] = $data;
}
}
}
return $slides;
}
// Put this in your product.php Shopp content template
echo do_shortcode('[wooslider size="mobile-slider"]');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment