Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $rambo_pro_theme_options = theme_data_setup();
- $current_options = wp_parse_args( get_option( 'rambo_pro_theme_options', array() ), $rambo_pro_theme_options );
- if($current_options['home_slider_enabled']==true)
- {
- if($current_options['slider_category'] !='')
- {
- $arg = array( 'post_type'=>'post','category__in' => $current_options['slider_category'],'ignore_sticky_posts' => 1);
- $loop = new WP_Query( $arg );
- if ( $loop->have_posts() ) :
- $t=true;
- ?>
- <script>
- jQuery(function() {
- // Homepage Main Slider Js
- jQuery("#slider-carousel").carousel( {
- interval:<?php echo $current_options['slider_transition_delay']; ?>,
- pause: "hover"
- });
- });
- </script>
- <div class="main_slider">
- <div id="slider-carousel" class="carousel slide <?php echo $current_options['slider_options']; ?>"data-ride="carousel" >
- <div class="carousel-inner">
- <!-- Carousel items -->
- <?php
- $slide_count = 0;
- while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <div id="post-<?php the_ID(); ?>" class="item <?php if( $t == true ){ echo 'active'; } $t = false; ?>" >
- <?php
- $btn_enable = sanitize_text_field( get_post_meta( get_the_ID(), 'btn_enable', true ));
- $btn_text = sanitize_text_field( get_post_meta( get_the_ID(), 'btn_text', true ));
- $btn_link = sanitize_text_field( get_post_meta( get_the_ID(), 'btn_link', true ));
- $btn_target = sanitize_text_field( get_post_meta( get_the_ID(), 'btn_target', true ));
- $default_arg =array('class' => "img-responsive");
- if(has_post_thumbnail()){ the_post_thumbnail('', $default_arg); }
- ?>
- <div class="container slider_con">
- <h2><?php echo the_title(); ?></h2>
- <?php if( has_excerpt() ): ?>
- <h5 class="slide-title"><span><?php echo get_the_excerpt(); ?></span></h5>
- <?php endif;
- if($btn_enable):
- ?>
- <a class="slide-btn" href="<?php echo $btn_link; ?>" <?php if( $btn_target) echo 'target="_blank"'; ?>><?php echo $btn_text; ?></a>
- <?php endif; ?>
- </div>
- </div>
- <?php
- $slide_count = $slide_count+1;
- endwhile;
- ?>
- </div>
- <?php if($slide_count > 1) {?>
- <!-- Carousel nav -->
- <ul class="carou-direction-nav">
- <li><a class="carou-prev" href="#slider-carousel" data-slide="prev"></a></li>
- <li><a class="carou-next" href="#slider-carousel" data-slide="next"></a></li>
- </ul>
- <?php } ?>
- </div>
- </div>
- <?php endif; }
- else {
- $current_options = get_option( 'rambo_pro_theme_options');
- if(!empty($current_options)){
- get_template_part('index','sliderold');
- }}
- }
- ?>
- <!-- /End of Slider -->
- <!-- /Slider -->
Add Comment
Please, Sign In to add comment