To generate a thumbnail for certain part of my theme i'm using the following code :
if(has_post_thumbnail() && !post_password_required() && !is_attachment() && wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()))):
$thumbnail_url = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()));
$thumbnail = get_the_post_thumbnail(get_the_ID() );
else:
$thumbnail_url[0] = get_template_directory_uri(). '/assets/images/no-image.jpg';
$thumbnail = '<img src="'.esc_url(get_template_directory_uri(). '/assets/images/no-image.jpg').'" alt="'.get_the_title().'" />';
endif;
echo '<div class="post-thumbnail">'.$thumbnail.'</div>';
I would like to be able to add a class and an id from the post it's attached to to my code on this line $thumbnail = get_the_post_thumbnail(get_the_ID() );
but I can't figure out how to modify the code accordingly.
I want to be able to add some lightbox options to my thumbnails.