Guest User

Untitled

a guest
Mar 30th, 2019
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.71 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. $the_query->the_post();
  115. $slider_link = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_link', true ));
  116. $slider_target = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_target', true ));
  117. ?>
  118. <div id="post-<?php the_ID(); ?>" class="item <?php if( $t == true ){ echo 'active'; } $t = false; ?>" >
  119. <?php $default_arg =array('class' => "img-responsive"); ?>
  120. <?php
  121. // check for the background image
  122. if(has_post_thumbnail())
  123.  
  124. if($slider_link!=''){
  125. ?> <a href="<?php echo $slider_link; ?>" <?php if($slider_target=='on'){ echo 'target="_blank"';} ?>><?php
  126. the_post_thumbnail('', $default_arg);
  127. ?>
  128. </a>
  129. <?php
  130.  
  131. } else
  132. {
  133.  
  134. the_post_thumbnail('', $default_arg);
  135. }
  136.  
  137.  
  138.  
  139. else echo '<img class="img-responsive" src="'.WEBRITI_TEMPLATE_DIR_URI.'/images/slide/no-image.jpg">';
  140.  
  141. //// display post content as per the their formats
  142.  
  143. //Post format aside
  144. if ( has_post_format( 'aside' )) {
  145. if($post->post_content !="")
  146. {
  147. ?>
  148. <div class="format-aside">
  149. <?php the_content(); ?>
  150. </div>
  151. <?php }
  152. }
  153.  
  154. //Post format quote
  155. elseif( has_post_format( 'quote' ))
  156. {
  157. ?>
  158. <div class="format-quote">
  159. <?php the_content(); ?>
  160. <small><cite title="Source Title"><?php the_title();?></cite></small>
  161. </div>
  162. <?php
  163. }
  164.  
  165. //Post format status
  166. elseif ( has_post_format( 'status' )) {
  167.  
  168. if($post->post_content !="")
  169. {?>
  170. <div class="status-caption"><div class="status-text-bg1"><h2><?php the_content(); ?></h2></div></div>
  171. <?php
  172. }
  173. }
  174.  
  175. //Post format video
  176. elseif ( has_post_format( 'video' ))
  177. {
  178. //print_r($slider_readmore_target);
  179. //wp_die();
  180. get_template_part('content-slider','video');
  181. }
  182. else { // Standard post format
  183.  
  184. ?>
  185. <div class="container slide-caption">
  186. <?php if($post->post_title !="") { ?>
  187. <div class="slide-text-bg1"><h2><?php the_title();?></h2></div><?php } //echo "<pre>"; print_r($post);wp_die();
  188. if($post->post_excerpt !=''){ ?>
  189. <div class="slide-text-bg2"><span><?php echo(get_the_excerpt()); ?></span></div>
  190. <?php }
  191. $slider_readmore_enable = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_enable', true ));
  192. $slider_readmore_txt = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_txt', true ));
  193. $slider_readmore_link = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_link', true ));
  194. $slider_readmore_target = sanitize_text_field( get_post_meta( get_the_ID(), 'slider_readmore_target', true ));
  195. if($slider_readmore_enable == 'on'){
  196. ?>
  197. <div class="slide-btn-area-sm"><a href="<?php echo $slider_readmore_link ;?>" <?php if($slider_readmore_target=='on'){ echo 'target="_blank"';} ?> class="slide-btn-sm"><?php if($slider_readmore_txt!=''){ _e($slider_readmore_txt,"appointment");} else{ _e("Read More","appointment");}?></a></div>
  198. <?php
  199. }
  200.  
  201. ?>
  202. </div>
  203. <?php } ?>
  204. </div> <!-- item class div close-->
  205. <?php }
  206.  
  207. } wp_reset_postdata(); ?>
  208. </div><!-- carousel-inner class div close-->
  209. <!-- Pagination -->
  210. <?php if($i>1){ ?>
  211. <ul class="carou-direction-nav">
  212. <li><a class="carou-prev" href="#carousel-example-generic" data-slide="prev"></a></li>
  213. <li><a class="carou-next" href="#carousel-example-generic" data-slide="next"></a></li>
  214. </ul>
  215. <?php } ?>
  216. <!-- /Pagination -->
  217. </div>
  218. </div>
  219. <!-- /Slider Section -->
  220. <?php } ?>
Add Comment
Please, Sign In to add comment