Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $graphene_settings;
- /**
- * Prints out the scripts required for the featured posts slider
- */
- if ( ! function_exists( 'graphene_scrollable' ) ) :
- function graphene_scrollable() {
- global $graphene_settings;
- $interval = ( $graphene_settings['slider_speed'] ) ? $graphene_settings['slider_speed'] : 7000;
- $speed = $graphene_settings['slider_trans_speed'];
- ?>
- <!-- Scrollable -->
- <script type="text/javascript">
- //<![CDATA[
- jQuery(document).ready(function($){
- <?php if ( $graphene_settings['slider_animation'] == 'horizontal-slide' ) : ?>
- $("#slider_root")
- .scrollable({
- circular: true,
- clickable: false,
- speed: <?php echo $speed; ?>
- })
- .navigator({
- navi: '.slider_nav',
- naviItem: 'a',
- activeClass: 'active'
- })
- .autoscroll({
- interval: <?php echo $interval; ?>,
- steps: 1,
- api: 'true'
- });
- $.graphene_slider = $("#slider_root").data("scrollable");
- <?php else :
- if ( $graphene_settings['slider_animation'] == 'vertical-slide' ){
- $effect = 'slide';
- }
- if ( $graphene_settings['slider_animation'] == 'fade' ){
- $effect = 'fade';
- }
- if ( $graphene_settings['slider_animation'] == 'none' ){
- $effect = 'default';
- }
- ?>
- $( ".slider_nav" )
- .tabs( ".slider_items > .slider_post", {
- effect: '<?php echo $effect; ?>',
- fadeOutSpeed: <?php echo $speed; ?>,
- fadeInSpeed: <?php echo $speed; ?>,
- rotate: true,
- current: 'active'
- })
- .slideshow({
- autoplay: true,
- clickable: false,
- interval: <?php echo $interval; ?>,
- api: true
- });
- $.graphene_slider = $(".slider_nav").data("tabs");
- <?php endif; ?>
- <?php do_action( 'graphene_scrollable_script' ); ?>
- });
- //]]>
- </script>
- <!-- #Scrollable -->
- <?php
- }
- endif;
- /**
- * Creates the functions that output the slider
- */
- function graphene_slider(){
- global $graphene_settings, $graphene_in_slider;
- $graphene_in_slider = true;
- if ( $graphene_settings['slider_display_style'] == 'bgimage-excerpt' )
- graphene_set_excerpt_length( 35 );
- do_action( 'graphene_before_slider' ); ?>
- <?php
- /* Generate classes for the slider wrapper */
- $class = array( 'featured_slider', 'clearfix' );
- $class[] = $graphene_settings['slider_display_style'];
- $class[] = $graphene_settings['slider_animation'];
- /* For backward compatibility */
- if ( $graphene_settings['slider_display_style'] == 'bgimage-excerpt' )
- $class[] = 'full-sized';
- $class = apply_filters( 'graphene_slider_class', $class );
- $class = implode( ' ', $class );
- ?>
- <div class="<?php echo $class; ?>">
- <?php do_action( 'graphene_before_slider_root' ); ?>
- <div id="slider_root" class="clearfix">
- <?php do_action( 'graphene_before_slideritems' ); ?>
- <div class="slider_items">
- <?php
- /* Get the posts to be displayed */
- $sliderposts = graphene_get_slider_posts();
- /* Display each post in the slider */
- $slidernav_html = '';
- $i = 0;
- while ( $sliderposts->have_posts() ) : $sliderposts->the_post();
- $style = '';
- /* Slider background image*/
- if ( $graphene_settings['slider_display_style'] == 'bgimage-excerpt' ) {
- $image = graphene_get_slider_image( get_the_ID(), 'graphene_slider', true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement