Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Template Name: Portfolio */
- get_header();
- //query_posts('post_type=portfolio&posts_per_page=9');
- ?>
- <!-- Filter through caterogies-->
- <div class="clearfix">
- <div class="toolbar mb2 mt2">
- <ul>
- <li><a class="btn fil-pic" data-rel="all">All</a></li>
- <li><a class="btn fil-pic" data-rel="graphic-design">Graphic Design</a></li>
- <li><a class="btn fil-pic" data-rel="web-design">Web Design</a></li>
- <li><a class="btn fil-pic" data-rel="illustration">Illustration</a></li>
- </ul>
- </div>
- <?php
- $args = array(
- 'posts_per_page' => -1,
- 'post_type' => 'cmtdsgn-portfolio',
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- 'taxonomy' => 'category'
- );
- $query = new WP_Query( $args );?>
- <?php if (have_posts() ) : while (have_posts() ) : the_post(); ?>
- <div id="mygallery">
- <div class="justified-gallery <?php foreach(( wp_get_post_terms(get_the_ID(), 'cmtdsgn-portfolio') ) as $category) { echo $category->slug . ' '; } ?>" data-my-order="1">
- <a href="<?php echo get_permalink($post->ID); ?>">
- <img src="<?php bloginfo('template_directory'); ?> ''">
- <div class="overlay"></div>
- <div class="gallery-item-text">Lorem Ipsum Dolor</div>
- </a>
- </div>
- </div>
- <?php endwhile; else: ?>
- <p>There is nothing to see here</p>
- <?php endif; ?>
- </div>
- <!-- Filter through caterogies-->
- <div id="mygallery" class="justified-gallery">
- <?php
- $args = array(
- 'post_type' => 'cmtdsgn-portfolio', // Your custom post type
- 'posts_per_page' => '5', // Change the number to whatever you wish
- 'order_by' => 'date', // Some optional sorting
- 'order' => 'ASC',
- );
- //echo '<div class="grid-x grid-padding-x small-up-1 medium-up-1 large-up-1">';
- //echo '<div class="cell">';
- echo '<a class="fancybox jg-entry tile scale-anm bcards entry-visible all" rel="group1">';
- $new_query = new WP_Query ($args);
- if ($new_query->have_posts()) {
- //echo '<a href="">';
- while($new_query->have_posts()){
- $new_query->the_post();
- echo '<div class="caption">' , the_title(); '</div>';
- echo '<img alt="Portfolio_item' , the_post_thumbnail('thumbnail'); '>';
- // Get a list of post's categories
- //$categories = get_the_category($post->ID);
- //foreach ($categories as $category) {
- //echo $category->name;
- //}
- }
- echo '</a>';
- }
- //echo '</div>';
- //echo '</div>';
- wp_reset_postdata(); ?>
- </div>
- <div style="clear:both;"></div>
- </div>
- <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment