Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $current_options = wp_parse_args( get_option( 'spa_theme_options', array() ), default_data() );
- $call_us = $current_options['call_us'];
- $slider_entries_main = $current_options['slider_entries_main'];
- $slider_bannerstrip_enable = $current_options['slider_bannerstrip_enable'];
- $args = array( 'post_type' => 'spa_slider', 'posts_per_page'=>$slider_entries_main );
- $loop = new WP_Query( $args );
- ?>
- <!-- Slider with Thumbnails -->
- <div id="main" role="main">
- <section class="slider">
- <div id="slider" class="flexslider">
- <ul class="slides">
- <?php
- if( $loop->have_posts() ):
- while ( $loop->have_posts() ) : $loop->the_post();
- $my_meta = get_post_meta( $post->ID ,'_my_meta', TRUE );
- if(isset($my_meta['link']))
- { $meta_value_link = $my_meta['link']; }
- else
- { $meta_value_link = get_permalink(); }
- if(isset($my_meta['check']))
- { $target ='target="_blank"'; } else { $target ='target="_self"'; }
- ?>
- <li>
- <?php
- if( has_post_thumbnail() ):
- $title = get_post( get_post_thumbnail_id() )->post_title;
- $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(),'full' );
- $alt_text = get_post_meta( get_post_thumbnail_id() , '_wp_attachment_image_alt', true);
- ?>
- <a href="<?php echo $meta_value_link ; ?>" <?php echo $target; ?> >
- <img alt="<?php echo $alt_text ?>" src="<?php echo $large_image_url[0]; ?>" title="<?php echo $title ?>"/>
- </a>
- <?php endif; ?>
- <?php if( $slider_bannerstrip_enable == 'yes' && isset($my_meta['banner_enable']) == true ): ?>
- <div class="container topbar-detail">
- <div class="col-md-3">
- <div class="title">
- <h4><?php if( isset( $my_meta['heading_one'] ) ){ echo $my_meta['heading_one']; } ?></h4>
- <h1><?php if( isset( $my_meta['heading_two'] ) ){ echo $my_meta['heading_two']; } ?></h1>
- </div>
- </div>
- <div class="col-md-6">
- <p class="description">
- <?php if( isset( $my_meta['banner_description'] ) ){ echo $my_meta['banner_description']; } ?>
- </p>
- </div>
- <div class="col-md-3"><div class="addr-detail"><address><?php echo $current_options['call_us_text']; ?> <strong><?php echo $call_us; ?></strong></address></div></div>
- </div>
- <?php endif; ?>
- </li>
- <?php
- endwhile;
- else :
- for( $i=1; $i<=8; $i++){
- echo ' <li>
- <img alt="img" src="'.(get_template_directory_uri()).'/images/default/image_2000x800.jpg" />
- <div class="container topbar-detail">
- <div class="col-md-3"><div class="title"><h4>Get Yourself</h4><h1>Refreshed</h1></div></div>
- <div class="col-md-6"><p class="description">Donec justo odio, lobortis eget congue sed, rutrum sit amet mauris. Curabitur sed lectus nulla. Curabitur sed lectus nulla.lobortis eget congue sed, rutrum sit amet mauris. Curabitur sed lectus nulla rutrum sit amet mauris</p></div>
- <div class="col-md-3"><div class="addr-detail"><address>CALL US ON <strong>201 567 8978</strong></address></div></div>
- </div>
- </li>';
- }
- endif;
- ?>
- </ul>
- </div>
- <?php
- if( $current_options['slider_thumbnails_enable'] == 'yes' ) :
- $loop2 = new WP_Query ( array('post_type' => 'spa_slider', 'posts_per_page'=>$slider_entries_main ));
- ?>
- <div class="container thumb-caption-detail">
- <div class="row">
- <div id="carousel" class="flexslider">
- <ul class="slides">
- <?php
- if( $loop2->have_posts() ):
- while ( $loop2->have_posts() ) : $loop2->the_post();
- $my_meta = get_post_meta($post->ID, '_my_meta', TRUE);
- ?>
- <li>
- <?php
- if( has_post_thumbnail() ):
- $title = get_post(get_post_thumbnail_id())->post_title;
- $thumb_bread_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(),'full');
- $alt_text = get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
- ?>
- <img alt="<?php echo $alt_text ?>" src="<?php echo $thumb_bread_image_url[0]; ?>" title="<?php echo $title; ?>" />
- <?php endif; ?>
- <div class="thumb-caption">
- <span>
- <?php if( isset( $my_meta['heading_one'] ) )
- { echo $my_meta['heading_one']; }
- ?>
- <h4>
- <?php if( isset( $my_meta['heading_two'] ))
- { echo $my_meta['heading_two']; }
- ?>
- </h4></span>
- <?php
- if( isset( $my_meta['link'] ) )
- { $meta_value_link = $my_meta['link']; }
- else
- { $meta_value_link = get_permalink(); }
- if( isset( $my_meta['check'] ) )
- { $target ='target="_blank"'; } else { $target ='target="_self"'; }
- ?>
- <a href="<?php echo $meta_value_link; ?>" <?php echo $target; ?> class="thumb-btn"><?php _e("Explore More",'spasalon');?> </a>
- </div>
- </li>
- <?php
- endwhile;
- else:
- for( $i=1; $i<=8; $i++){
- echo '<li><img alt="img" src="'.(get_template_directory_uri()).'/images/default/image_2000x800.jpg" />
- <div class="thumb-caption">
- <span>PRODUCING<h4>QUALITY</h4></span>
- <a href="#" class="thumb-btn">Explore More </a>
- </div>
- </li>';
- }
- endif;
- ?>
- </ul>
- </div>
- </div>
- </div>
- <?php endif; ?>
- </section>
- </div>
- <!-- End of Slider with Thumbnails -->
- <script>
- jQuery('#slider').flexslider({
- animation: "<?php echo $current_options['slide_effect_main']; ?>",
- controlNav: false,
- animationLoop: false,
- slideshow: true,
- slideshowSpeed: <?php echo $current_options['animation_speed_main']; ?>,
- animationSpeed: <?php echo $current_options['auto_slide_interval_main']; ?>,
- sync: "#carousel",
- start: function(slider){
- jQuery('body').removeClass('loading');
- }
- });
- </script>
- <div class="clearfix"></div>
Add Comment
Please, Sign In to add comment