Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $gallery_items = get_terms('gallery_cats_iteams');
- if(!empty($gallery_items) && ! is_wp_error($gallery_items)):
- ?>
- <div class="row">
- <!--Portfolio Filter-->
- <div class="col-md-12 portfolio-filter text-center">
- <ul>
- <li class="active" data-filter="*">All</li>
- <?php foreach( $gallery_items as $gallery_item): ?>
- <li data-filter=".<?php echo $gallery_item->slug ?>"><?php echo $gallery_item->name ?></li>
- <?php endforeach; ?>
- </ul>
- </div>
- </div>
- <?php endif; ?>
- <!--Portfolio Items-->
- <div id="lightgallery" class="row portfolio-items mb-50">
- <?php
- $cv_gallery_item=new WP_Query(array(
- 'post_type' => 'cv_gallery',
- 'posts_per_page' =>-1,
- ));
- while($cv_gallery_item->have_posts()) : $cv_gallery_item->the_post();
- $image_link = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
- $cv_gallery = get_the_terms($post->ID,'gallery_cats_iteams');
- if($cv_gallery && !is_wp_error($cv_gallery)):
- $cv_gallery_cat_slug = array();
- foreach($cv_gallery as $cv_gallery_iteam){
- $cv_gallery_cat_slug [] =$cv_gallery_iteam->slug;
- }
- $cv_gallery_cat_array =join(", ", $cv_gallery_cat_slug);
- $cv_gallery_class_array =join(" ", $cv_gallery_cat_slug);
- endif;
- ?>
- <!--Portfolio Item-->
- <div class="item col-lg-4 col-sm-6 <?php echo $cv_gallery_class_array; ?>" data-src="<?php echo $image_link['0']; ?>">
- <a href="javascript:">
- <figure>
- <?php the_post_thumbnail(); ?>
- <figcaption>
- <h4><?php the_title(); ?></h4>
- <p><?php echo $cv_gallery_cat_array; ?></p>
- </figcaption>
- </figure>
- </a>
- </div>
- <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement