How to add a lightbox to class mix?

If you only need to add a “lightbox” class to each element you just need to change this :

 echo'<div class="mix '.$item_classes.'">'.get_the_post_thumbnail().'</div>';

to this :

echo'<div class="mix lightbox '.$item_classes.'">'.the_post_thumbnail('thumbnail', array('class' => 'lightbox')) .'</div>';

And if you want to add the full size image to be opened, try this :

$featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'full');
echo'<div class="mix lightbox '.$item_classes.'"><a href="' . esc_url($featured_img_url) . '">' . the_post_thumbnail('thumbnail', array('class' => 'lightbox')) .'</a></div>';

check this for all the sizes available