Last active
December 24, 2015 10:19
-
-
Save clifgriffin/6783559 to your computer and use it in GitHub Desktop.
Making WooSlider and Shopp play nicely together.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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