Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
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.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Marketing cookies are used to follow visitors to websites. The intention is to show ads that are relevant and engaging to the individual user.