Tagged: featured image
Hi, I implemented a solution to have a Pinterest icon appear on all images of my site, which can be clicked and have the image pinned on pinterest.
However, I can’t get it working on post featured images, because of Enfold’s default link to the image itself.
Searching the forum, I found this, but it’s of no help, since it disables all pointer events on the featured image, including my pinterest overlay and link:
.blog .big-preview.single-big { pointer-events: none; }
So I need another solution (without changing core Enfold files) please.
Here is a page on the site, notice how the pinterest button appears on all post images, except the featured image.
Is there a hook or something to disable Enfold’s featured image link?
Thanks,
Tom
Hey Tom,
Try adding this code to the end of your functions.php file in Appearance > Editor:
function remove_featured_image_link(){
?>
<script>
(function($){
$(document).ready(function(){
$('.big-preview.single-big a').contents().unwrap();
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'remove_featured_image_link');
and add this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:
.big-preview.single-big img {
z-index: 0 !important;
}
Best regards,
Mike
You’re an ace Mike, it worked. Thanks for your help!
Tom
Hi fisherman,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
Victoria