Guest User

Untitled

a guest
Dec 5th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.80 KB | None | 0 0
  1. <?php
  2. $appointment_options = theme_setup_data();
  3. $project_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_options);
  4. if ($project_setting['portfolio_section_enabled'] == 0) {
  5. ?>
  6. <!-- Portfolio Section -->
  7. <div class="portfolio-section">
  8.  
  9. <div class="container">
  10. <!-- Section Title -->
  11. <div class="row">
  12. <div class="col-md-12">
  13. <div class="section-heading-title">
  14.  
  15. <h1><?php echo $project_setting['portfolio_title']; ?></h1>
  16. <p class="section-description"><?php echo $project_setting['portfolio_description']; ?></p>
  17.  
  18. </div>
  19. </div>
  20. </div>
  21. <!-- /Section Title -->
  22. <style>
  23. .owl-nav{
  24. text-align: center;
  25. margin: 50px 0;
  26. }
  27. .owl-nav .fa-angle-left,
  28. .owl-nav .fa-angle-right{
  29. margin: 0 5px;
  30. width: 40px;
  31. height: 40px;
  32. border-radius: 50%;
  33. text-align: center;
  34. font-size: 28px;
  35. color: #fff;
  36. background: #383838;
  37. line-height: 38px;
  38. cursor: pointer
  39. }
  40. .portfolio-area{
  41. margin-bottom: 0px;
  42. }
  43.  
  44. </style>
  45. <div class="owl-carousel owl-theme">
  46. <?php
  47. $post_type = 'appoint_portfolio';
  48.  
  49. $args = array(
  50. 'post_type' => $post_type,
  51. 'tax_query' => array(
  52. array(
  53. 'taxonomy' => 'portfolio_categories',
  54. 'field' => 'id',
  55. 'terms' => $project_setting['portfolio_selected_category_id'],
  56. //'operator' => 'NOT IN',
  57. ),
  58. ),
  59. 'posts_per_page' => $project_setting['portfolio_list'],
  60. 'post_status' => 'publish');
  61.  
  62. $portfolio_query = null;
  63. $portfolio_query = new WP_Query($args);
  64. if ($portfolio_query->have_posts()) {
  65. while ($portfolio_query->have_posts()) : $portfolio_query->the_post();
  66. $project_description = sanitize_text_field(get_post_meta(get_the_ID(), 'project_description', true));
  67. $project_more_btn_link = sanitize_text_field(get_post_meta(get_the_ID(), 'project_more_btn_link', true));
  68. $project_link_chkbx = sanitize_text_field(get_post_meta(get_the_ID(), 'project_link_chkbx', true));
  69. ?>
  70. <div class="item portfolio-area">
  71. <div class="portfolio-image">
  72. <?php
  73. if (has_post_thumbnail()) {
  74. $class = array('class' => 'img-responsive');
  75. the_post_thumbnail('', $class);
  76. $post_thumbnail_id = get_post_thumbnail_id();
  77. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);
  78. }
  79. ?>
  80. <div class="portfolio-showcase-overlay">
  81. <div class="portfolio-showcase-overlay-inner">
  82. <div class="portfolio-showcase-icons">
  83. <?php if (isset($post_thumbnail_url)) { ?>
  84. <a href="<?php echo $post_thumbnail_url; ?>" data-lightbox="image" title="<?php the_title(); ?>" class="hover_thumb"><i class="fa fa-search"></i></a>
  85. <?php } ?>
  86. <?php if (!empty($project_more_btn_link)) { ?>
  87. <a href="<?php echo $project_more_btn_link; ?>" <?php
  88. if (!empty($project_link_chkbx)) {
  89. echo 'target="_blank"';
  90. }
  91. ?> title="Appointment" class="hover_thumb"><i class="fa fa-plus"></i></a>
  92. <?php } ?>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="portfolio-caption">
  98. <h4><?php if (!empty($project_more_btn_link)) { ?>
  99. <a href="<?php echo $project_more_btn_link; ?>" <?php
  100. if (!empty($project_link_chkbx)) {
  101. echo 'target="_blank"';
  102. }
  103. ?> class="hover_thumb"><?php the_title(); ?></a>
  104. <?php } else the_title(); ?></h4>
  105.  
  106. <?php if (get_post_meta(get_the_ID(), 'project_description', true)) {
  107. ?>
  108. <p><?php echo get_post_meta(get_the_ID(), 'project_description', true); ?></p>
  109. <?php } ?>
  110. </div>
  111. </div>
  112. <?php
  113. endwhile;
  114. }
  115. ?>
  116. </div>
  117. </div></div>
  118. <!-- /Portfolio Section -->
  119. <div class="clearfix"></div>
  120.  
  121. <script>
  122. jQuery(document).ready(function ($) {
  123. owl = $('.owl-carousel')
  124. owl.owlCarousel({
  125. center: false,
  126. loop: false,
  127. margin: 20,
  128. items: 3,
  129. dots: false,
  130. responsive: {
  131. 0: {
  132. items: 1,
  133. navigation: false,
  134. nav: true,
  135. slideBy: 1 // <!-- HERE
  136. },
  137. 640: {
  138. items: 3,
  139. navigation: false,
  140. nav: true,
  141. slideBy: 3 // <!-- HERE
  142. }
  143. },
  144. scrollPerPage: true,
  145. navigation: true
  146. }).css("z-index", 0)
  147.  
  148. });
  149. </script>
  150. <?php } ?>
Add Comment
Please, Sign In to add comment