archive-portfolios.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. get_header();
  3. taskereasy_blog_banner();
  4. $portfoliotype = taskereasy_get_config('portfolio_type');
  5. ?>
  6. <section id="portfolio" class="section-padding">
  7. <div class="container">
  8. <div class="portfolioFilter">
  9. <ul>
  10. <li><a href="#" data-filter="*" class="current"><?php echo esc_html__('All', 'taskereasy') ?></a></li>
  11. <?php
  12. $terms = get_terms( 'portfoliocategories', 'orderby=asc&hide_empty=0' );
  13. foreach($terms as $term){ ?>
  14. <li><a href="#" data-filter=".<?php echo esc_js($term->name); ?>"><?php echo esc_html($term->name); ?></a></li>
  15. <?php } ?>
  16. </ul>
  17. </div>
  18. <?php if($portfoliotype == 'col-three') { ?>
  19. </div> <!---container close on col-three -->
  20. <?php } ?>
  21. <div class="portfolioContainer <?php echo esc_attr($portfoliotype); ?>">
  22. <?php if(have_posts()) {
  23. $count = 0;
  24. while(have_posts()){
  25. the_post();
  26. $termname = array();
  27. $terms = get_the_terms( '', 'portfoliocategories' );
  28. if ( !empty( $terms ) ) {
  29. foreach ($terms as $term) {
  30. $termname[] = $term->name;
  31. }
  32. } ?>
  33. <div class="portfolio-grid <?php echo implode(' ', $termname); ?>">
  34. <a href="<?php echo get_the_permalink(); ?>" class="link">
  35. <?php if(has_post_thumbnail()){ ?>
  36. <?php the_post_thumbnail(); ?>
  37. <?php } ?>
  38. <span class="img-mask lt"></span>
  39. <span class="img-mask rt"></span>
  40. <span class="img-mask lb"></span>
  41. <span class="img-mask rb"></span>
  42. <span class="title"><?php the_title(); ?></span>
  43. <span class="description"><?php echo taskereasy_custom_excerpt_length(20); ?></span>
  44. <span class="more"><?php echo esc_html__('More', 'taskereasy'); ?> <i class="fa fa-angle-right"></i></span>
  45. </a>
  46. </div>
  47. <?php $count++;
  48. }
  49. } ?>
  50. </div>
  51. <?php if($portfoliotype != 'col-three') { ?>
  52. </div> <!---container close on col-three -->
  53. <?php } ?>
  54. </section>
  55. <?php
  56. get_footer();
  57. ?>