Let’s take a look at how to add the Pinterest Pin it button over your images in WordPress. This button will appear only when the user brings their mouse over your images, allowing them to easily share the image on their Pinterest profile.
Upon activation, go to Settings » Pinterest Pin It page to configure the plugin.
On the settings page, you can choose where you want to show the “Pin It” button on your WordPress site. You can display it only on single posts, pages, category pages, or everywhere on your site.
The next option is to choose the default description from the dropdown menu. This will be used as the image description for the pinned image.
Once done, you need to click on the Save button to store the settings. Now you can visit your website and then hover your mouse cursor over any image to see the Pinterest “Pin It” button.
If you want to exclude some images from showing the Pin It button, then you can add the nopin CSS class to the images you want to exclude.
To do that, you need to select the image block in the post editor and then click on the 3 vertical dots icon from the block toolbar. This will open a menu where you need to click on the Edit as HTML option.
You will now see the HTML code of your image. Go ahead to add nopin to the class attribute of the img tag:
Similarly, you can also use the plugin to disable automatic display of the “Pin It” button, and use the CSS class “pinthis” to selectively display the button on specific images.
To do that, you need to visit the plugin’s settings page and then locate the Advanced section on the right side of the page.
Now you need to check the option that says ‘Show “Pin it” button only on images with class=”pinthis” ‘, and then click on the Save button.
The next time you add an image to a post or page, you need to select the image block and then use the Edit as HTML option to add the pinthis CSS class to the image code. Here is an example:
This will show the Pinterest button on that specific image, even if you have disabled the option to automatically show the Pin It button on your site.
We hope this article helped you understand how to add a Pinterest “Pin It” button to your WordPress blog. You may also want to see our guide on how to create an email newsletter and get more subscribers.