Show LightBox when clicking on featured image [closed]

If you use the following code you may fix your problem. Give it a try.Paste this in your post.php <?php if ( current_theme_supports( ‘get-the-image’ ) ): $image_full=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), ‘full’); $image_thumbnail=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), ‘single-thumbnail’); ?> <a href=”https://wordpress.stackexchange.com/questions/194146/<?php echo $image_full[0]; ?>” rel=”lightbox”> <img class=”alignnone wp-image-2770 size-single-thumbnail” src=”<?php echo $image_thumbnail[0]; ?>” alt=”2015-04-10_190211″ width=”636″ height=”460″ style=”opacity: 1;”> </a> … Read more

Add “data-” attribute to image links

while googling about the same issue I came upon your question and a similar question from the WordPress forums. You can control the output of the generated code via the image_send_to_editor filter like this: function filter_image_send_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) { $html = sprintf(‘<a href=”#” data-rel=”lightbox-0″><img alt=”%2$s” src=”%1$s” /></a>’, esc_attr(esc_url($url)), esc_attr($title)); return … Read more