John Basile
asked 9 years ago

The fact that I haven’t had a question in over 6 months is testament to what a great theme Focus is! For some reason, my lightbox on Featured images has stopped working. Instead of popping off the page, it directs to the image file from my uploads folder. Any idea what may have knocked it off? I can’t tell if there’s a plugin that controls this behavior of if it’s coded right into the theme. Thanks for any help.

1 Answers
DominicStaff
answered 9 years ago

Hi,
At the moment, our theme does not support Lightbox feature, if you want to display image in as a lightbox, you can use the WP Lightbox 2 plugin.
Then open the .php file and find the following code: <?php the_post_thumbnail(''); ?>
then replace it with the following code:

<?php $featured_img = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post->ID ), 'single-post-thumbnail' );  ?>
<?php if ($featured_img) { ?>
<div class="lightbox-img featured-img-wrap">
<a href="<?php echo $featured_img[0]; ?>" rel="lightbox"><img src="<?php echo $featured_img[0]; ?>" /></a></div>
<?php } ?> 

Hope this helps !

solarfeeds
replied 9 years ago

Awesome. Thanks, Dominic.

Powered by DW Question & Answer Pro