darshan_saroya

home-slider.php

Mar 30th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. <!-- Carousel -->
  2. <?php $wl_theme_options = get_option('enigma_options_pro');
  3. $side_interval = $wl_theme_options['side_interval']; ?>
  4. <div id="myCarousel" class="carousel slide" data-ride="carousel" <?php if($wl_theme_options['side_pause']=="yes") { echo "data-pause='false'"; } ?> data-interval="<?php echo $side_interval; ?>">
  5. <?php $all_posts = wp_count_posts( 'weblizar_slider')->publish;
  6. $args = array( 'post_type' => 'weblizar_slider','posts_per_page' =>$all_posts);
  7. $slider = new WP_Query( $args );
  8. if( $slider->have_posts() )
  9. { $t=1; ?>
  10. <div class="carousel-inner">
  11. <?php while ( $slider->have_posts() ) : $slider->the_post(); ?>
  12. <div class="item <?php if($t==1) { echo 'active'; } ?>">
  13. <?php if(has_post_thumbnail()):
  14. $defalt_arg =array('class'=>"img-responsive");
  15. the_post_thumbnail('', $defalt_arg);
  16. endif; ?>
  17. <div class="container">
  18. <div class="carousel-caption" <?php if( $wl_theme_options['front_pg']=='parallax') { ?> style="top:35% !important" <?php } ?> >
  19. <div class="carousel-text"><?php if(the_title('','','')) { ?>
  20. <h1 class="animated bounceInRight"><?php the_title(); ?></h1>
  21. <?php } ?>
  22. <ul class="list-unstyled carousel-list">
  23. <?php if(get_post_meta( get_the_ID(),'slider_desciption', true )) { ?>
  24. <li class="animated bounceInLeft"><?php echo get_post_meta( get_the_ID(),'slider_desciption', true ); ?></li>
  25. <?php } ?>
  26. </ul>
  27. <?php if(get_post_meta( get_the_ID(),'slider_button_text', true )) { ?>
  28. <a href="<?php echo get_post_meta( get_the_ID(),'slider_button_link', true ); ?>" class="enigma_blog_read_btn animated bounceInUp" <?php if(get_post_meta( get_the_ID(),'slider_button_target', true )) { echo "target='_blank'"; }?> ><?php echo get_post_meta( get_the_ID(),'slider_button_text', true ); ?></a>
  29. <?php } ?>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. <?php $t++; endwhile; ?>
  35. </div>
  36. <ol class="carousel-indicators">
  37. <?php for($i=0; $i<$t-1; $i++) { ?>
  38. <li data-target="#myCarousel" data-slide-to="<?php echo $i; ?>" <?php if($i==0) { echo 'class="active"'; } ?> ></li>
  39. <?php } ?>
  40. </ol><?php
  41. } else { ?>
  42. <div class="carousel-inner">
  43. <?php for($i=1; $i<=3; $i++) { ?>
  44. <div class="item <?php if($i==1) { echo 'active'; } ?>">
  45. <img src="<?php echo WL_TEMPLATE_DIR_URI ?>/images/slide/slider-bg-<?php echo $i; ?>.jpg" >
  46. <div class="container">
  47. <div class="carousel-caption">
  48. <div class="carousel-text">
  49. <h1 class="animated bounceInRight">Responsive Theme</h1>
  50. <ul class="list-unstyled carousel-list">
  51. <li class="animated bounceInLeft">Lorem ipsum dolor sit amet, consectetur adipiscing metus elit. Quisque rutrum pellentesque imperdiet</li>
  52. </ul>
  53. <a href="#" class="enigma_blog_read_btn animated bounceInUp">Read More</a>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <?php } ?>
  59. </div>
  60. <!-- Indicators -->
  61. <ol class="carousel-indicators">
  62. <?php for($i=0; $i<3; $i++) { ?>
  63. <li data-target="#myCarousel" data-slide-to="<?php echo $i; ?>" <?php if($i==0) { echo 'class="active"'; } ?> ></li>
  64. <?php } ?>
  65. </ol>
  66. <?php } if($all_posts >= "2") { ?>
  67. <a class="left carousel-control" href="#myCarousel" data-slide="prev" ><span class="glyphicon glyphicon-chevron-left" ></span></a>
  68. <a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
  69. <?php } ?>
  70. </div><!-- /.carousel -->
  71. <!-- / Slider-->
Add Comment
Please, Sign In to add comment