Advertisement
Guest User

Untitled

a guest
Mar 16th, 2021
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.90 KB | None | 0 0
  1. <?php
  2. $arilewp_portfolio_templates_title = get_theme_mod('arilewp_portfolio_templates_title', 'Our Portfolio');
  3. $arilewp_portfolio_templates_desc = get_theme_mod('arilewp_portfolio_templates_desc', '<b>Recent</b> Projects');
  4. $arilewp_portfolio_category_disabled = get_theme_mod('arilewp_portfolio_category_disabled', true);
  5. $arilewp_portfolio_templates_container_size = get_theme_mod('arilewp_portfolio_templates_container_size', 'container-full');
  6. ?>
  7.  
  8. <section class="theme-block theme-project theme-bg-grey">
  9.  
  10. <?php if($arilewp_portfolio_templates_title != null || $arilewp_portfolio_templates_desc != null) :?>
  11. <div class="container">
  12. <div class="row">
  13. <div class="col-lg-12 col-md-12 col-xs-12">
  14. <div class="theme-section-module text-center">
  15. <?php if($arilewp_portfolio_templates_title != null ) : ?>
  16. <p class="theme-section-subtitle wow animate fadeInLeft" data-wow-delay=".3s"><?php echo $arilewp_portfolio_templates_title; ?></p>
  17. <?php endif; ?>
  18. <?php if($arilewp_portfolio_templates_desc != null ) : ?>
  19. <h2 class="theme-section-title wow animate fadeInRight" data-wow-delay=".3s"><?php echo $arilewp_portfolio_templates_desc; ?></h2>
  20. <?php endif; ?>
  21. <div class="theme-separator-line-horrizontal-full wow animate fadeInUpBig" data-wow-delay=".3s"></div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <?php endif; ?>
  27.  
  28.  
  29.  
  30. <div class="<?php echo $arilewp_portfolio_templates_container_size; ?>">
  31. <?php $post_type = 'arilewp_portfolio';
  32. $tax = 'portfolio_categories';
  33. $term_args=array( 'hide_empty' => true,'orderby' => 'id');
  34. $tax_terms = get_terms($tax, $term_args);
  35. $defualt_tex_id = get_option('arilewp_default_term_id');
  36. $j=1;
  37. $tab= get_option('tab');
  38. if(isset($_GET['div']))
  39. {
  40. $tab=$_GET['div'];
  41. }
  42. ?>
  43. <?php if($arilewp_portfolio_category_disabled == true) : ?>
  44. <div class="row">
  45. <div class="col-md-12">
  46. <ul id="tabs" class="nav filter-tabs justify-content-center wow animated fadeInUpBig" data-wow-delay=".3s">
  47. <?php foreach ($tax_terms as $tax_term) {
  48. ?>
  49. <li class="nav-item"><a class="nav-link <?php if($tab==''){if($j==1){echo 'active';$j=2;}}else if($tab==$tax_term->slug){echo 'active';}?>" id="tab" href="#<?php echo $tax_term->slug; ?>" data-toggle="tab"><?php echo $tax_term->name; ?></a></li>
  50. <?php } ?>
  51. </ul>
  52. </div><!-- .row -->
  53. </div><!-- .row -->
  54. <?php endif; ?>
  55. <div id="content" class="tab-content" role="tablist">
  56. <?php
  57. global $paged;
  58. $curpage = $paged ? $paged : 1;
  59. $norecord=0;
  60. $min_post_start=0;
  61. $is_active=true;
  62.  
  63. if ($tax_terms)
  64. {
  65. foreach ($tax_terms as $tax_term)
  66. {
  67. if(isset($_POST['min_post_start']))
  68. { $min_post_start = $_POST['min_post_start']; }
  69. $args = array (
  70. 'max_num_pages' =>5,
  71. 'post_status' => 'publish',
  72. 'post_type' => $post_type,
  73. 'portfolio_categories' => $tax_term->slug,
  74. 'paged' => $curpage,
  75. 'posts_per_page' => 20,
  76. );
  77. $portfolio_query = null;
  78. $portfolio_query = new WP_Query($args);
  79. if( $portfolio_query->have_posts() ):
  80. ?>
  81. <div id="<?php echo $tax_term->slug; ?>" class="tab-pane fade in <?php if($tab==''){if($is_active==true){echo 'show active';}$is_active=false;}else if($tab==$tax_term->slug){echo 'show active';} ?>">
  82. <div class="row">
  83. <?php while ($portfolio_query->have_posts()) : $portfolio_query->the_post(); ?>
  84. <?php
  85. $custom_portfolio_target = sanitize_text_field( get_post_meta( get_the_ID(), 'custom_portfolio_target', true ));
  86. if(get_post_meta( get_the_ID(),'custom_portfolio_link', true )) {
  87. $custom_portfolio_link = get_post_meta( get_the_ID(),'custom_portfolio_link', true );
  88. } else { $custom_portfolio_link = ''; }
  89. $class = '';
  90.  
  91. if(is_page_template('page-templates/portfolio-2-col.php')) {
  92. $class = 'col-lg-6 col-md-6 col-sm-12';
  93. }
  94. if(is_page_template('page-templates/portfolio-3-col.php')) {
  95. $class = 'col-lg-4 col-md-6 col-sm-12';
  96. }
  97. if(is_page_template('page-templates/portfolio-4-col.php')) {
  98. $class = 'col-lg-3 col-md-6 col-sm-12';
  99. }
  100. echo '<div class="'.$class.'">';
  101. ?>
  102. <article class="theme-project-content border-0 wow animated flipInY" data-wow-delay=".3s">
  103. <figure class="portfolio-thumbnail">
  104. <?php
  105. if(has_post_thumbnail()){
  106. echo '<a href="'.esc_url(get_the_permalink()).'">';
  107. the_post_thumbnail( '', array( 'class'=>'img-fluid' ) );
  108. echo '</a>'; }
  109. if(has_post_thumbnail())
  110. {
  111. $post_thumbnail_id = get_post_thumbnail_id();
  112. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id );
  113. }
  114. ?>
  115. <div class="click-view">
  116. <div class="thumbnail-showcase-icons">
  117. <?php if(isset($post_thumbnail_url)){ ?>
  118. <a href="<?php echo $post_thumbnail_url; ?>" data-lightbox="image" title="<?php the_title(); ?>"><i class="fa fa-search"></i></a>
  119. <?php } ?>
  120. <?php if(!empty($custom_portfolio_link)) {?>
  121. <a href="<?php echo $custom_portfolio_link;?>" <?php if(!empty($custom_portfolio_target)){ echo 'target="_blank"'; } ?>><i class="fa fa-link"></i></a>
  122. <?php } ?>
  123. </div>
  124. </div>
  125. </figure>
  126. <span class="content-area">
  127. <h5 class="theme-project-title"><?php if(!empty($custom_portfolio_link)) {?>
  128. <a href="<?php echo $custom_portfolio_link;?>" <?php if(!empty($custom_portfolio_target)){ echo 'target="_blank"'; } ?> class="hover_thumb"><?php the_title(); ?></a>
  129. <?php } else the_title(); ?>
  130. </h5>
  131. <?php if(get_post_meta( get_the_ID(), 'custom_portfolio_description', true )){ ?>
  132. <p><?php echo get_post_meta( get_the_ID(), 'custom_portfolio_description', true ); ?></p>
  133. <?php } ?>
  134.  
  135. </span>
  136. </article>
  137. <?php echo '</div>'; ?>
  138. <?php
  139. $norecord=1;
  140. ?>
  141. <?php endwhile; ?>
  142. </div>
  143. </div>
  144. <?php
  145. wp_reset_query();
  146. else:
  147. ?>
  148. <div id="<?php echo $tax_term->slug; ?>" class="tab-pane fade in <?php if($tab==''){if($is_active==true){echo 'active';}$is_active=false;}else if($tab==$tax_term->slug){echo 'active';} ?>"></div>
  149. <?php
  150. endif;
  151. }
  152. }
  153. ?>
  154. </div><!-- .tab-content -->
  155. </div><!-- .container-full -->
  156. </div><!-- .container-full -->
  157. </section> <!-- .page-builder -->
  158. <!-- /Portfolio Section -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement