Documentation, Reference Materials and Tutorials for Envira Gallery
When users hover over images in Envira Gallery, browser extensions such as Pinterest’s “Pin It” button can overlay the images, prompting users to pin the content. If you prefer to maintain a clean, distraction-free aesthetic or discourage pinning, you might want to disable this feature. This tutorial walks you through how to prevent Pinterest buttons from appearing when users hover over your gallery images.
To disable the Pinterest “Pin It” button from appearing over images on hover, you can implement a straightforward code snippet. Follow the instructions in this document to add custom PHP code safely to your WordPress site.
Here’s the code snippet you’ll need:
/* Envira - Disable Pinterest Button on Image Hover * * @link https://enviragallery.com/docs/how-to-disable-pinterest-pin-it-button-browser-extension/ */ function envira_disable_pinterest_button( $atts, $id, $item, $data, $i ) { return $atts . 'nopin="nopin"'; } add_filter( 'envira_gallery_output_image_attr', 'envira_disable_pinterest_button', 10, 5 ); add_filter( 'envira_albums_output_image_attr', 'envira_disable_pinterest_button', 10, 5 );
By implementing this customization, you can maintain complete control over how your images are shared, preserving the integrity and style of your Envira Gallery. This is particularly useful for photographers and artists looking to curate a specific viewer experience.
And that’s it, you’re all done! Would you like to try some more cool things with Envira? Check out our tutorial on How to Style Pagination Links.
A: Yes, the above code will disable the Pin It button for both galleries and albums.
Envira Gallery: Create, Showcase, and Sell Your Work – Trusted by 150k+ Sites.
Enter the URL of your WordPress website to install
Unlock even more powerful features designed to make your galleries even more beaituful.
Video Galleries
eCommerce
Social media Sharing
Adobe Lightroom
And much more!
Copyright © [#this year :%Y] Envira Gallery, LLC. Envira Gallery is a trademark of Envira Gallery, LLC.