Skip to content

Instantly share code, notes, and snippets.

@technovangelist
Created February 20, 2014 16:30
Show Gist options
  • Save technovangelist/9117720 to your computer and use it in GitHub Desktop.
Save technovangelist/9117720 to your computer and use it in GitHub Desktop.
Using RoyalSlider with Placester Property Images
<?php
/**
* Template Name: SliderTest
*/
wp_enqueue_style( 'royal_slider_css', get_template_directory_uri() . "/royalslider/royalslider.css");
wp_enqueue_style( "royal_slider_default_skin_css", get_template_directory_uri() . "/royalslider/skins/default/rs-default.css" );
wp_enqueue_script( "royal_slider_js", get_template_directory_uri() . "/royalslider/jquery.royalslider.min.js");
get_header( );
?>
<div class='royalSlider rsDefault'>
<?php
$listings = PL_Listing::get(array('limit' => 10));
foreach ($listings[listings] as $listing)
echo "<img class='rsImg' src='" . $listing[images][0][url] . "'/>";
?>
</div>
<script>
jQuery(document).ready(function($) {
jQuery(".royalSlider").royalSlider({
keyboardNavEnabled: true,
autoScaleSlider:true,
loop:true,
autoplay: {
enabled:true,
delay:2000
}
});
});
</script>
<?php get_footer( ); ?>
@justinledelson
Copy link

How could I also pull the address of the listing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment