Guest User

Untitled

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