Make image header (at the top of a post) display as Fancybox
-
I’ve been searching for quite some time, trying to figure out what the appropriate code would be to make the image (at the top of my post, before the title) linkable to its full size version and open it via Fancybox.
This is the code I currently have in place:
<?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'top-post-thumbnail', 'link_to_post' => false, 'image_class' => 'featured', 'attachment' => false, 'width' => 470 ) ); ?>
I thought adding an anchor that would get the permalink would do it, but it just links to the post (like the link_to_post does).
So the code needs to figure out what image it is, then link to the full size source, and open it in Fancybox. At least I think that’s the correct logic. I’m new to WP and PHP so I’m not all that sure of its limitations.
For reference: https://www.brianholt.ca/but-i-really-really-like-you/
- The topic ‘Make image header (at the top of a post) display as Fancybox’ is closed to new replies.