Guest User

Untitled

a guest
Apr 20th, 2019
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.42 KB | None | 0 0
  1. <!-- Slider Section -->
  2. <?php
  3. $appointment_options=theme_setup_data();
  4. $slider_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options);
  5.  
  6.  
  7. if($slider_setting['home_banner_enabled'] == 0 ) {
  8. ?>
  9. <div class="homepage-mycarousel">
  10. <div id="carousel-example-generic" class="carousel slide <?php echo $slider_setting['slider_options']; ?>"data-ride="carousel"
  11. <?php if($slider_setting['slider_transition_delay'] != '') { ?> data-interval="<?php echo $slider_setting['slider_transition_delay']; } ?>" >
  12. <!-- Indicators -->
  13. <?php
  14. $query_args = array();
  15. if($slider_setting['slider_radio'] == 'demo') { ?>
  16. <ol class="carousel-indicators">
  17. <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
  18. <li data-target="#carousel-example-generic" data-slide-to="1"></li>
  19. <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  20. <li data-target="#carousel-example-generic" data-slide-to="3"></li>
  21. <li data-target="#carousel-example-generic" data-slide-to="4"></li>
  22. </ol>
  23. <div class="carousel-inner" role="listbox">
  24. <div class="item active">
  25. <img src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/slide/slide1.jpg">
  26. <div class="container slide-caption">
  27. <div class="slide-text-bg1"><h2><?php _e('Powerful Bootstrap Theme','appointment'); ?></h2></div>
  28. <div class="slide-text-bg2"><span><?php _e('This is a very powerful theme that can be used for any type of business. The layout is clean and elegant.','appointment'); ?></span></div>
  29. <div class="slide-btn-area-sm"><a href="#" class="slide-btn-sm"><?php _e('Read More','appointment'); ?></a></div>
  30. </div>
  31. </div>
  32. <div class="item">
  33. <img src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/slide/slide2.jpg">
  34. <div class="status-caption">
  35. <div class="status-text-bg1">
  36. <h2><?php _e('This is a very powerful theme that can be used for any type of business. The layout is clean and elegant.','appointment'); ?> </h2>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="item">
  41. <img src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/slide/slide3.jpg">
  42. <div class="format-aside">
  43. <p><?php _e('This is a very powerful theme that can be used for any type of business. The layout is clean and elegant.','appointment'); ?></p>
  44. </div>
  45. </div>
  46.  
  47. <div class="item">
  48. <img src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/slide/slide1.jpg">
  49. <div class="format-quote">
  50. <p><?Php echo 'Sed ut Perspiciatis Unde Omnis Iste Sed ut perspiciatis unde omnis iste natu error sit voluptatem accu tium neque fermentum veposu miten a tempor nise. Duis autem vel eum iriure dolor in hendrerit in vulputate velit consequat reprehender in voluptate velit esse cillum duis dolor fugiat nulla pariatur.'; ?></p>
  51. <small><cite title="Source Title"><?php echo 'Martin Doe'; ?></cite></small>
  52. </div>
  53. </div>
  54.  
  55. <div class="item">
  56. <img src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/slide/slide2.jpg">
  57. <div class="container format-video">
  58. <div class="row">
  59. <div class="col-md-6">
  60. <div class="video-frame">
  61. <iframe src="https://player.vimeo.com/video/50597841" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
  62. </div>
  63. </div>
  64. <div class="col-md-6">
  65. <div class="video-content">
  66. <h1><?php _e('Video format','appointment'); ?></h1>
  67. <p><?php _e('This is an example of a video post format displayed in the featured slider with an excerpt added.','appointment'); ?></p>
  68. <a href="#" class="format-video-btn-sm"><?php _e('Read More','appointment'); ?></a>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <ul class="carou-direction-nav">
  76. <li><a class="carou-prev" href="#carousel-example-generic" data-slide="prev"></a></li>
  77. <li><a class="carou-next" href="#carousel-example-generic" data-slide="next"></a></li>
  78. </ul>
  79. <?php
  80. }
  81.  
  82. else
  83. {
  84. $featured_slider_post = $slider_setting['featured_slider_post'];
  85.  
  86. $slider_select_category = array();
  87. $slider_select_category = $slider_setting['slider_select_category' ];
  88.  
  89. $query_args = array( 'category__in' => $slider_select_category,'ignore_sticky_posts' => 1 ,'posts_per_page' =>$featured_slider_post);
  90.  
  91. }
  92. $t=true;
  93.  
  94. $the_query = new WP_Query($query_args);
  95. ?>
  96. <ol class="carousel-indicators">
  97. <?php
  98. global $post;
  99. $i=0;
  100. if ( $the_query->have_posts() ) {
  101.  
  102. while ( $the_query->have_posts() ) {
  103.  
  104. $the_query->the_post(); ?>
  105. <li data-target="#carousel-example-generic" data-slide-to="<?php echo $i;?>" class="<?php if($i==0){ echo 'active';} ?>"></li>
  106. <?php $i++; }
  107. }?>
  108. </ol>
  109. <div class="carousel-inner" role="listbox">
  110. <?php
  111.  
  112. if ( $the_query->have_posts() ) {
  113. while ( $the_query->have_posts() ) {
  114.  
  115. $slider_readmore_enable = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_enable', true ));
  116. $slider_readmore_txt = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_txt', true ));
  117. $slider_readmore_link = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_link', true ));
  118. $slider_readmore_target = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_target', true ));
  119.  
  120. $the_query->the_post();
  121.  
  122. ?>
  123. <div id="post-<?php the_ID(); ?>" class="item <?php if( $t == true ){ echo 'active'; } $t = false; ?>" >
  124. <?php $default_arg =array('class' => "img-responsive"); ?>
  125. <?php
  126. // check for the background image
  127. if(has_post_thumbnail())
  128. {
  129. ?>
  130.  
  131.  
  132. <a href="<?php echo $slider_readmore_link ;?>" <?php if($slider_readmore_target=='on'){ echo 'target="_blank"';} ?> class="">
  133. <?php the_post_thumbnail('', $default_arg); ?>
  134. </a>
  135.  
  136. <?php
  137. }
  138. else echo '<img class="img-responsive" src="'.WEBRITI_TEMPLATE_DIR_URI.'/images/slide/no-image.jpg">';
  139.  
  140. //// display post content as per the their formats
  141.  
  142. //Post format aside
  143. if ( has_post_format( 'aside' )) {
  144. if($post->post_content !="")
  145. {
  146. ?>
  147. <div class="format-aside">
  148. <?php the_content(); ?>
  149. </div>
  150. <?php }
  151. }
  152.  
  153. //Post format quote
  154. elseif( has_post_format( 'quote' ))
  155. {
  156. ?>
  157. <div class="format-quote">
  158. <?php the_content(); ?>
  159. <small><cite title="Source Title"><?php the_title();?></cite></small>
  160. </div>
  161. <?php
  162. }
  163.  
  164. //Post format status
  165. elseif ( has_post_format( 'status' )) {
  166.  
  167. if($post->post_content !="")
  168. {?>
  169. <div class="status-caption"><div class="status-text-bg1"><h2><?php the_content(); ?></h2></div></div>
  170. <?php
  171. }
  172. }
  173.  
  174. //Post format video
  175. elseif ( has_post_format( 'video' ))
  176. {
  177. //print_r($slider_readmore_target);
  178. //wp_die();
  179. get_template_part('content-slider','video');
  180. }
  181. else { // Standard post format
  182.  
  183. ?>
  184. <div class="container slide-caption">
  185. <?php if($post->post_title !="") { ?>
  186. <div class="slide-text-bg1"><h2><?php the_title();?></h2></div><?php } //echo "<pre>"; print_r($post);wp_die();
  187. if($post->post_excerpt !=''){ ?>
  188. <div class="slide-text-bg2"><span><?php echo(get_the_excerpt()); ?></span></div>
  189. <?php }
  190.  
  191. if($slider_readmore_enable == 'on'){
  192. ?>
  193. <div class="slide-btn-area-sm">
  194. <a href="<?php echo $slider_readmore_link ;?>" <?php if($slider_readmore_target=='on'){ echo 'target="_blank"';} ?> class="slide-btn-sm">
  195. <?php if($slider_readmore_txt!=''){ _e($slider_readmore_txt,"appointment");} else{ _e("Read More","appoitment");}?></a></div
  196. <?php
  197. }
  198.  
  199. ?>
  200. </div>
  201. <?php } ?>
  202. </div> <!-- item class div close-->
  203. <?php }
  204.  
  205. } wp_reset_postdata(); ?>
  206. </div><!-- carousel-inner class div close-->
  207. <!-- Pagination -->
  208. <?php if($i>1){ ?>
  209. <ul class="carou-direction-nav">
  210. <li><a class="carou-prev" href="#carousel-example-generic" data-slide="prev"></a></li>
  211. <li><a class="carou-next" href="#carousel-example-generic" data-slide="next"></a></li>
  212. </ul>
  213. <?php } ?>
  214. <!-- /Pagination -->
  215. </div>
  216. </div>
  217. <!-- /Slider Section -->
  218. <?php } ?>
Add Comment
Please, Sign In to add comment