Created
September 18, 2018 08:35
-
-
Save neilgee/b5df702da5ef092b4cd48d57dec32768 to your computer and use it in GitHub Desktop.
Link Featured Image to Linked Media Image
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
<?php | |
// Create the variable for the large image src link | |
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); | |
// Out the Post Title Using the post permalink for the post link - then the image which links to its large size | |
?> | |
<h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> | |
<a class="lightboxclassname" href="<?php echo $large_image_url[0]; ?>" title="<?php the_title_attribute(); ?>" > | |
<?php the_post_thumbnail('medium'); ?></a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment