Created
February 20, 2014 16:30
-
-
Save technovangelist/9117720 to your computer and use it in GitHub Desktop.
Using RoyalSlider with Placester Property Images
This file contains hidden or 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 | |
/** | |
* 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( ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How could I also pull the address of the listing?