How to Isotope filtering on Custom Post Type where i am wrong please guide me

by Yogesh Pawar   Last Updated August 14, 2019 15:08 PM

i am fillter category wise using custom post type but i didn't get category slug

 <?php $loop = new WP_Query( array( 'post_type' => 'our_work','order' => 'Desc') ); 
 <div align="center">

    $categories = get_categories();
     foreach($categories as $category){

          echo'<button class="btn btn-default filter-button" data-filter=".'.$category ->slug.'">'.$category->name.'</button>'; 


        <?php while ( $loop->have_posts() ) : $loop->the_post(); 

        <div class="gallery_product col-lg-4 col-md-4 col-sm-4 col-xs-6 filter ">
            <img src="<?php the_post_thumbnail_url(); ?>" class="img-responsive">
        <?php endwhile; ?>

Related Questions

DIVI Page Builder using Advanced Custom Fields PRO

Updated January 03, 2018 21:08 PM

Help with Multi Level Category Archive Page

Updated August 13, 2016 08:03 AM

Custom Post Archive is not working

Updated September 28, 2017 20:08 PM

Custom post type meta box field won't save

Updated September 06, 2017 18:08 PM