Guest User

Untitled

a guest
Dec 4th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. <!-- Portfolio Section -->
  2. <div class="portfolio-main-section">
  3. <div class="container">
  4. <?php
  5. $post_type = 'elitepress_portfolio';
  6. $tax = 'portfolio_categories';
  7. $term_args=array( 'hide_empty' => true,'orderby' => 'id');
  8. $tax_terms = get_terms($tax, $term_args);
  9. $defualt_tex_id = get_option('elitepress_webriti_default_term_id');
  10.  
  11. $j=1;
  12. $tab= get_option('tab');
  13.  
  14. ?>
  15. <!-- Tabs -->
  16. <div class="row">
  17. <div class="col-md-12">
  18. <div class="portfolio-tabs-section">
  19. <ul class="portfolio-tabs" id="mytabs">
  20. <?php foreach ($tax_terms as $tax_term) {
  21. $tax_term_name = str_replace(' ', '_', $tax_term->name);
  22. $tax_term_name = preg_replace('~[^A-Za-z\d\s-]+~u', 'elitepress', $tax_term_name);
  23. ?>
  24.  
  25. <li class="tab <?php if($tab==''){if($j==1){echo 'active';$j=2;}}else if($tab==$tax_term_name){echo 'active';}?>" >
  26.  
  27. <a href="#<?php echo $tax_term_name; ?>" data-toggle="tab"><i class="fa fa-stop"></i><?php echo $tax_term->name; ?></a>
  28. </li>
  29. <?php } ?>
  30. </ul>
  31. </div>
  32. </div>
  33. </div>
  34. <!-- /Tabs -->
  35.  
  36. <!-- Portfolio Area -->
  37. <div class="tab-content main-portfolio-section" id="myTabContent">
  38. <?php $norecord=0;
  39. if ($tax_terms)
  40. { foreach ($tax_terms as $tax_term)
  41. { $count_posts = wp_count_posts( $post_type)->publish;
  42. $args = array (
  43. 'post_type' => $post_type,
  44. 'portfolio_categories' => $tax_term->slug,
  45. 'posts_per_page' =>$count_posts,
  46. 'post_status' => 'publish');
  47. global $j;
  48. $j=1;
  49. $portfolio_query = null;
  50. $portfolio_query = new WP_Query($args);
  51. if( $portfolio_query->have_posts() )
  52. {
  53. $tax_term_name = str_replace(' ', '_', $tax_term->name);
  54. $tax_term_name = preg_replace('~[^A-Za-z\d\s-]+~u', 'elitepress', $tax_term_name); ?>
  55. <div id="<?php echo $tax_term_name; ?>" class="tab-pane fade in <?php if($tab==''){if($is_active==true){echo 'active';}$is_active=false;}else if($tab==$tax_term->name){echo 'active';} ?>">
  56.  
  57. <div class="row">
  58. <?php
  59. while ($portfolio_query->have_posts()) { $portfolio_query->the_post();
  60. if(get_post_meta( get_the_ID(),'project_more_btn_link', true ))
  61. { $project_more_btn_link = get_post_meta( get_the_ID(),'project_more_btn_link', true );
  62. } else {
  63. $project_more_btn_link = '';
  64. } ?>
  65.  
  66. <?php if(is_page_template('portfolio-2-column.php')) { ?>
  67. <div class="col-md-6 col-sm-6 portfolio-area-main">
  68. <?php } ?>
  69.  
  70. <?php if(is_page_template('portfolio-3-column.php')) { ?>
  71. <div class="col-md-4 col-sm-6 portfolio-area-main">
  72. <?php } ?>
  73.  
  74. <?php if(is_page_template('portfolio-4-column.php')) { ?>
  75. <div class="col-md-3 col-sm-6 portfolio-area-main">
  76. <?php } ?>
  77.  
  78.  
  79.  
  80. <div class="portfolio_image_main">
  81. <?php if(is_page_template('portfolio-2-column.php')) {
  82. elitepress_image_thumbnail('','img-responsive');
  83. } ?>
  84.  
  85. <?php if(is_page_template('portfolio-3-column.php')) {
  86. elitepress_image_thumbnail('','img-responsive');
  87. } ?>
  88.  
  89. <?php if(is_page_template('portfolio-4-column.php')) {
  90. elitepress_image_thumbnail('','img-responsive');
  91. } ?>
  92.  
  93. <?php
  94. if(has_post_thumbnail())
  95. {
  96. $post_thumbnail_id = get_post_thumbnail_id();
  97. $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id );
  98. } ?>
  99. <div class="portfolio_showcase_overlay">
  100. <div class="portfolio_showcase_overlay_inner">
  101. <div class="portfolio_showcase_icons">
  102. <?php if(isset($post_thumbnail_url)){ ?>
  103. <a href="<?php echo $post_thumbnail_url; ?>" data-lightbox="image" title="<?php the_title(); ?>" class="hover_thumb"><i class="fa fa-search"></i></a>
  104. <?php }
  105. elitepress_get_custom_link($project_more_btn_link,get_post_meta( get_the_ID(), 'project_more_btn_target', true ),'<i class="fa fa-link"></i>'); ?>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="portfolio_caption">
  111. <h4>
  112. <?php
  113. elitepress_get_custom_link($project_more_btn_link,get_post_meta( get_the_ID(), 'project_more_btn_target', true ),get_the_title()); ?>
  114. </h4>
  115. <?php if(get_post_meta( get_the_ID(), 'project_description', true )){ ?>
  116. <p><?php echo get_post_meta( get_the_ID(), 'project_description', true ); ?></p>
  117. <?php }
  118. if (get_post_meta( get_the_ID(), 'project_more_btn_text', true )){ ?>
  119. <div class="port-btn"><a href="<?php echo $project_more_btn_link; ?>" <?php if(get_post_meta( get_the_ID(), 'project_more_btn_target', true )) { echo "target='_blank'"; } ?> title="Read More"><?php echo get_post_meta( get_the_ID(), 'project_more_btn_text', true ); ?><i class="fa fa-angle-right"></i></a></div>
  120. <?php } ?>
  121. </div>
  122. </div>
  123. <?php
  124. // call clearfix css class
  125. elitepress_portfolio_clearfix($j);
  126.  
  127. $norecord=1; } ?>
  128.  
  129. </div>
  130. </div>
  131. <?php } } }
  132. wp_reset_query(); ?>
  133. </div>
  134. <!-- /Portfolio Area -->
  135.  
  136. </div>
  137. </div>
  138. <!-- /Portfolio Section -->
  139. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment