iknaeem

Untitled

Dec 1st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.54 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.  
  23. <div class="col-md-12">
  24. <div class="carousel slide" data-ride="carousel" data-type="multi" data-interval="false" id="newCarousel">
  25. <div class="carousel-inner">
  26.  
  27. <?php
  28. $post_type = 'appoint_portfolio';
  29.  
  30. $args = array(
  31. 'post_type' => $post_type,
  32. 'tax_query' => array(
  33. array(
  34. 'taxonomy' => 'portfolio_categories',
  35. 'field' => 'id',
  36. 'terms' => $project_setting['portfolio_selected_category_id'],
  37. //'operator' => 'NOT IN',
  38. ),
  39. ),
  40. 'posts_per_page' => $project_setting['portfolio_list'],
  41. 'post_status' => 'publish');
  42. $j = 1;
  43. $portfolio_query = null;
  44. $portfolio_query = new WP_Query($args);
  45. if ($portfolio_query->have_posts()) {
  46. while ($portfolio_query->have_posts()) : $portfolio_query->the_post();
  47. $project_description = sanitize_text_field(get_post_meta(get_the_ID(), 'project_description', true));
  48. $project_more_btn_link = sanitize_text_field(get_post_meta(get_the_ID(), 'project_more_btn_link', true));
  49. $project_link_chkbx = sanitize_text_field(get_post_meta(get_the_ID(), 'project_link_chkbx', true));
  50. ?>
  51. <div class="item <?php if ($j == 1) {
  52. echo "active";
  53. $j++;
  54. } ?>">
  55. <div class="col-md-3 col-sm-6 col-xs-12 pull-left portfolio-area">
  56. <div class="portfolio-image">
  57. <?php
  58. if (has_post_thumbnail()) {
  59. $class = array('class' => 'img-responsive');
  60. the_post_thumbnail('', $class);
  61. $post_thumbnail_id = get_post_thumbnail_id();
  62. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);
  63. }
  64. ?>
  65. <div class="portfolio-showcase-overlay">
  66. <div class="portfolio-showcase-overlay-inner">
  67. <div class="portfolio-showcase-icons">
  68. <?php if (isset($post_thumbnail_url)) { ?>
  69. <a href="<?php echo $post_thumbnail_url; ?>" data-lightbox="image" title="<?php the_title(); ?>" class="hover_thumb"><i class="fa fa-search"></i></a>
  70. <?php } ?>
  71. <?php if (!empty($project_more_btn_link)) { ?>
  72. <a href="<?php echo $project_more_btn_link; ?>" <?php if (!empty($project_link_chkbx)) {
  73. echo 'target="_blank"';
  74. } ?> title="Appointment" class="hover_thumb"><i class="fa fa-plus"></i></a>
  75. <?php } ?>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="portfolio-caption">
  81. <h4><?php if (!empty($project_more_btn_link)) { ?>
  82. <a href="<?php echo $project_more_btn_link; ?>" <?php if (!empty($project_link_chkbx)) {
  83. echo 'target="_blank"';
  84. } ?> class="hover_thumb"><?php the_title(); ?></a>
  85. <?php } else the_title(); ?></h4>
  86.  
  87. <?php if (get_post_meta(get_the_ID(), 'project_description', true)) {
  88. ?>
  89. <p><?php echo get_post_meta(get_the_ID(), 'project_description', true); ?></p>
  90. <?php } ?>
  91. </div>
  92. </div></div>
  93. <?php $j++;
  94. endwhile;
  95. } ?>
  96. </div>
  97. <!-- Project Scroll -->
  98. <div class="row">
  99. <?php if ($j > 3) { ?>
  100. <div class="col-md-12">
  101. <ul class="project-scroll-btn">
  102. <li><a class="project-prev" href="#newCarousel" data-slide="prev"></a></li>
  103. <li><a class="project-next" href="#newCarousel" data-slide="next"></a></li>
  104. </ul>
  105. </div>
  106. <?php } ?>
  107. </div>
  108. <!-- /Project Scroll -->
  109. </div>
  110. </div>
  111. </div></div>
  112. <!-- /Portfolio Section -->
  113. <div class="clearfix"></div>
  114. <?php } ?>
Add Comment
Please, Sign In to add comment