Guest User

Untitled

a guest
Jun 22nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. <?php
  2. /* Template Name: Portfolio */
  3.  
  4.  
  5. get_header();
  6.  
  7. //query_posts('post_type=portfolio&posts_per_page=9');
  8.  
  9.  
  10. ?>
  11.  
  12.  
  13. <!-- Filter through caterogies-->
  14.  
  15. <div class="clearfix">
  16.  
  17. <div class="toolbar mb2 mt2">
  18. <ul>
  19. <li><a class="btn fil-pic" data-rel="all">All</a></li>
  20. <li><a class="btn fil-pic" data-rel="graphic-design">Graphic Design</a></li>
  21. <li><a class="btn fil-pic" data-rel="web-design">Web Design</a></li>
  22. <li><a class="btn fil-pic" data-rel="illustration">Illustration</a></li>
  23. </ul>
  24. </div>
  25.  
  26.  
  27. <?php
  28. $args = array(
  29. 'posts_per_page' => -1,
  30. 'post_type' => 'cmtdsgn-portfolio',
  31. 'orderby' => 'menu_order',
  32. 'order' => 'ASC',
  33. 'taxonomy' => 'category'
  34. );
  35. $query = new WP_Query( $args );?>
  36.  
  37.  
  38. <?php if (have_posts() ) : while (have_posts() ) : the_post(); ?>
  39.  
  40. <div id="mygallery">
  41.  
  42. <div class="justified-gallery <?php foreach(( wp_get_post_terms(get_the_ID(), 'cmtdsgn-portfolio') ) as $category) { echo $category->slug . ' '; } ?>" data-my-order="1">
  43.  
  44. <a href="<?php echo get_permalink($post->ID); ?>">
  45. <img src="<?php bloginfo('template_directory'); ?> ''">
  46.  
  47. <div class="overlay"></div>
  48. <div class="gallery-item-text">Lorem Ipsum Dolor</div>
  49. </a>
  50. </div>
  51.  
  52. </div>
  53. <?php endwhile; else: ?>
  54. <p>There is nothing to see here</p>
  55. <?php endif; ?>
  56. </div>
  57.  
  58.  
  59.  
  60.  
  61. <!-- Filter through caterogies-->
  62.  
  63.  
  64.  
  65.  
  66. <div id="mygallery" class="justified-gallery">
  67. <?php
  68.  
  69. $args = array(
  70. 'post_type' => 'cmtdsgn-portfolio', // Your custom post type
  71. 'posts_per_page' => '5', // Change the number to whatever you wish
  72. 'order_by' => 'date', // Some optional sorting
  73. 'order' => 'ASC',
  74. );
  75. //echo '<div class="grid-x grid-padding-x small-up-1 medium-up-1 large-up-1">';
  76. //echo '<div class="cell">';
  77. echo '<a class="fancybox jg-entry tile scale-anm bcards entry-visible all" rel="group1">';
  78. $new_query = new WP_Query ($args);
  79. if ($new_query->have_posts()) {
  80. //echo '<a href="">';
  81. while($new_query->have_posts()){
  82. $new_query->the_post();
  83.  
  84. echo '<div class="caption">' , the_title(); '</div>';
  85. echo '<img alt="Portfolio_item' , the_post_thumbnail('thumbnail'); '>';
  86.  
  87. // Get a list of post's categories
  88. //$categories = get_the_category($post->ID);
  89. //foreach ($categories as $category) {
  90. //echo $category->name;
  91. //}
  92. }
  93. echo '</a>';
  94. }
  95. //echo '</div>';
  96. //echo '</div>';
  97.  
  98. wp_reset_postdata(); ?>
  99. </div>
  100.  
  101.  
  102. <div style="clear:both;"></div>
  103.  
  104.  
  105. </div>
  106.  
  107.  
  108.  
  109.  
  110. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment