Guest User

Untitled

a guest
Jul 2nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. <?php
  2. /**
  3. * @Theme Name : Quality Pro
  4. * @file : index-testimonials.php
  5. * @package : Quality-Pro
  6. * @author : Hari Maliya
  7. * @license : license.txt
  8. * @filesource : wp-content/themes/quality/index-testimonials.php
  9. */
  10. ?>
  11. <!-- Quality Testimonial Section ---->
  12. <?php
  13. $testimonial_options = get_theme_mod('quality_testimonial_content');
  14. if(empty($testimonial_options))
  15. {
  16.  
  17. $quality_pro_options = get_option('quality_pro_options');
  18.  
  19. if(get_option('quality_pro_options')!='' && isset($quality_pro_options['home_testimonial_title'])){
  20.  
  21. $count_posts = wp_count_posts( 'quality_testimonial')->publish;
  22. $args = array( 'post_type' => 'quality_testimonial','posts_per_page' =>$count_posts);
  23. $testimonial = new WP_Query( $args );
  24.  
  25. if( $testimonial->have_posts() )
  26. {
  27. while ( $testimonial->have_posts() ) : $testimonial->the_post();
  28. $pro_testimonial_data_old[] = array(
  29. 'title' => get_the_title(),
  30. 'text' => get_post_meta( get_the_ID(), 'description_meta_save', true ),
  31. 'designation' => get_post_meta( get_the_ID(), 'author_designation_meta_save', true ),
  32. 'link' => '#',
  33. 'image_url' => get_the_post_thumbnail_url(),
  34. 'open_new_tab' => false,
  35. 'id' => 'customizer_repeater_56d7ea7f40b96',
  36. );
  37.  
  38. endwhile;
  39. $testimonial_options = json_encode($pro_testimonial_data_old);
  40. }
  41. }
  42. }
  43.  
  44. $quality_pro_options=theme_data_setup();
  45. $current_options = wp_parse_args( get_option( 'quality_pro_options', array() ), $quality_pro_options );
  46. $testi_slide_type=$current_options['testi_slide_type'];
  47. $testi_scroll_items=$current_options['testi_scroll_items'];
  48. $testi_scroll_duration=$current_options['testi_scroll_dura'];
  49. $testi_timeout_duration=$current_options['testi_timeout_dura'];
  50. ?>
  51. <script>
  52. jQuery(function(){
  53. jQuery('#qua-testimonial').carouFredSel({
  54. width: '100%',
  55. responsive : true,
  56. auto: { pauseOnHover: 'immediate' },
  57. circular: true,
  58. pagination: "#pager2",
  59. items: {
  60. visible: {
  61. min: 1,
  62. max: 2
  63. }
  64. },
  65. prev: '#prev3',
  66. next: '#next3',
  67. directon: 'left',
  68. scroll : {
  69. items : <?php echo $testi_scroll_items; ?>,
  70. duration : <?php echo $testi_scroll_duration; ?>,
  71. fx:'<?php echo $testi_slide_type; ?>',
  72. timeoutDuration : <?php echo $testi_timeout_duration; ?>
  73. },
  74. });
  75. });
  76. </script>
  77. <div class="qua_testimonial_carusel">
  78. <div class="container">
  79. <?php $quality_pro_options=theme_data_setup();
  80. $current_options = wp_parse_args( get_option( 'quality_pro_options', array() ), $quality_pro_options ); ?>
  81. <div class="qua_port_title">
  82. <?php if($current_options['home_testimonial_title']) { ?>
  83. <h1><?php echo $current_options['home_testimonial_title']; ?></h1>
  84. <?php }
  85. if($current_options['home_testimonial_desciption']) { ?>
  86. <p><?php echo $current_options['home_testimonial_desciption']; ?></p>
  87. <?php } ?>
  88. <div class="qua-separator" id=""></div>
  89. </div>
  90. <div class="row" id="qua-testimonial">
  91. <?php
  92.  
  93. $testimonial_options = json_decode($testimonial_options);
  94. if( $testimonial_options!='' )
  95. {
  96. foreach($testimonial_options as $testimonial_iteam){
  97.  
  98. $testimonial_title = ! empty( $testimonial_iteam->title ) ? apply_filters( 'quality_translate_single_string', $testimonial_iteam->title, 'Testimonial section' ) : '';
  99.  
  100. $text_desc = ! empty( $testimonial_iteam->text ) ? apply_filters( 'quality_translate_single_string', $testimonial_iteam->text, 'Testimonial section' ) : '';
  101.  
  102. $text_link = $testimonial_iteam->link;
  103. $open_new_tab = $testimonial_iteam->open_new_tab;
  104.  
  105.  
  106. $designation = ! empty( $testimonial_iteam->designation ) ? apply_filters( 'quality_translate_single_string', $testimonial_iteam->designation, 'Testimonial section' ) : '';
  107.  
  108.  
  109. ?>
  110. <div class="col-md-6 col-sm-12 pull-left">
  111. <div class="media">
  112. <div class="pull-left qua_testimonianl_sec">
  113. <?php if($testimonial_iteam->image_url !=''): ?>
  114.  
  115. <?php if($text_link!=''){?>
  116. <a href="<?php echo $text_link; ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>>
  117. <?php }?>
  118. <img class="img-responsive" alt="Author" src="<?php echo $testimonial_iteam->image_url; ?>" draggable="false">
  119. <?php if($text_link!=''){?>
  120. </a>
  121. <?php }?>
  122.  
  123. <?php endif; ?>
  124. <p>
  125. <?php if($text_link!=''){?>
  126. <a href="<?php echo $text_link; ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>><?php }?>
  127. <?php echo $testimonial_title; ?>
  128. <?php if($text_link!=''){?></a><?php }?>
  129. </p>
  130.  
  131. <i class="fa fa-caret-right"></i>
  132. </div>
  133. <div class="media-body">
  134.  
  135. <?php if($text_desc!=''){ ?>
  136. <p class="qua_testimonianl_content"><?php echo $text_desc; ?></p>
  137. <?php } ?>
  138.  
  139. <?php if($designation !='') {?>
  140. <a href="<?php echo $text_link; ?>" <?php if($open_new_tab == 'yes'){ echo 'target="_blank"';}?>> <h3 class="qua_testimonianl_desig"><?php echo $designation; ?></h3></a>
  141. <?php } ?>
  142.  
  143. </div>
  144. </div>
  145. </div>
  146. <?php
  147.  
  148. } }else {
  149. $name =array(__('Lerry Beth','quality'), __('Anna Kathleen','quality'), __('Laura Michelle','quality'), __('Angela Mcarthy','quality'));
  150. $desc =array(__('Interior Designer','quality'), __('DEVELOPER','quality'), __('Sr Therapist','quality'), __('Architect','quality'));
  151.  
  152. for($i=0; $i<4; $i++) { ?>
  153. <div class="col-md-6 col-sm-12 pull-left">
  154. <div class="media">
  155. <div class="pull-left qua_testimonianl_sec">
  156. <a href="#"><img class="media-object" src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/testi-img2.png"></a>
  157. <p><a href="#"><?php echo $name[$i]; ?></a></p>
  158. <i class="fa fa-caret-right"></i>
  159. </div>
  160. <div class="media-body">
  161. <p class="qua_testimonianl_content"><?php _e('This is where you could add a short bio about the owner or staff of your establishment This is where you could add a short Testimonial about the owner or staff of your establishment quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.','quality'); ?></p>
  162. <h3 class="qua_testimonianl_desig"><?php echo $desc[$i]; ?></h3>
  163. </div>
  164. </div>
  165. </div>
  166. <?php }
  167. }?>
  168. </div>
  169. <div class="row">
  170. <div id="pager2" class="pager testi-pager"></div>
  171. </div>
  172. </div>
  173. </div>
  174. <!-- /Quality Testimonial Section ---->
Add Comment
Please, Sign In to add comment