Reply To: Hover text on featured image

Home Forums Support Hover text on featured image Reply To: Hover text on featured image

Home Forums Support Hover text on featured image Reply To: Hover text on featured image

#197217
Patrick Maylone

DOH! I’m guessing that the css has been listed previously in the forum. I went to add it to my child theme and it was there at the end commented out, along with my other formatting that I recreated. Again thank you. The rabbit hole may not be so bad after all…

So to bring things up to date to get the Featured image to show up under the menu, and before the content I inserted the code into the After Header field in the GP Hooks plug-in and checked the Execute PHP box.

My goal was to also have the featured image show the images Alt Attribute when you hover over it, and to open up in lightbox when it was clicked on. (I’ve found that this has made reading the comic on mobile much easier). I also needed (not that I realized with the original request) for the featured image to stay when you click into the entry itself. From what Tom gave me, what I found in WP documentation, and a lot of trial and error I now have this:

<div class="post-image">
    <a rel="lightbox" href="<?php the_post_thumbnail_url(); ?>" title="<?php $thumb_id = get_post_thumbnail_id(get_the_ID()); $alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);  if(count($alt)) echo $alt; ?>">
<?php the_post_thumbnail(); ?></a>
</div>

It seems to be working as I want. In my case, because I wanted to have the image appear in the actual entries as well I removed the begging and closing part of the If Statement
To keep the featured image from displaying in the actual blog entry I used Tom’s CSS from above.

Tom, I thank you again for the helping hand. I suspect I will be back when I get to the under comic navigation but for now, I think we got it.