Instead of linking a featured image to a post permalink in a loop – here is how you can link to its original image of itself.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So above, the title and featured image is output of a post – the title has a link to the post whilst the image is linked to itself via the $large_image_url which uses the first value in the array [0] which is the src value.
Further more a lightbox CSS class name can be triggered so a bunch of featured images can be viewed in an archive loop page without going to the single post page
Thanks for sharing.
Could you please elaborate on the last paragraph a little bit ? Thanks,
“Further more a lightbox CSS class name can be triggered so a bunch of featured images can be viewed in an archive loop page without going to the single post page”
Here’s an example http://dev.tovo2.websitelove.net/lights/ so it’s a loop of lights, the headline links to the light post but the featured image opens in a lightbox which has prev/next and keeps the user on the archive page.
2 comments
Thomas
Thanks for sharing.
Could you please elaborate on the last paragraph a little bit ? Thanks,
“Further more a lightbox CSS class name can be triggered so a bunch of featured images can be viewed in an archive loop page without going to the single post page”
Neil Gowran
Here’s an example http://dev.tovo2.websitelove.net/lights/ so it’s a loop of lights, the headline links to the light post but the featured image opens in a lightbox which has prev/next and keeps the user on the archive page.