Skip to content

Instantly share code, notes, and snippets.

@yeriepiscesa
Last active March 4, 2020 13:35
Show Gist options
  • Save yeriepiscesa/712b50153858d75345b7809dd0d2c745 to your computer and use it in GitHub Desktop.
Save yeriepiscesa/712b50153858d75345b7809dd0d2c745 to your computer and use it in GitHub Desktop.
Post Carousel using Oxygen Builder - Kode dari tutorial https://solusipress.com/membuat-post-slider-pada-oxygen-builder-basic/
<link rel="stylesheet" href="<?php echo CT_FW_URI . '/vendor/unslider/unslider.css' ?>">
<script type="text/javascript" src="<?php echo CT_FW_URI . '/vendor/unslider/unslider-min.js' ?>"></script>
<script type="text/javascript">
(function($){
$( '.post-sliders .oxy-repeater-pages-wrap' ).remove();
<?php if( !is_admin() ): ?>
$( '.post-sliders' ).each( function(){
var the_html = $(this).html();
$(this).replaceWith( $( '<div class="the-sliders"><ul>' + the_html + '</ul></div>' ) );
});
$( '.post-slider-item' ).each( function(){
var the_html = $(this).html();
$(this).replaceWith( $( '<li>' + the_html + '</li>' ) );
});
$(function() {
$('.the-sliders').unslider();
});
<?php endif; ?>
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment