Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client needed to prevent the "Pin it" button from appearing on the language flag images on their website. The "Pin it" button developer suggested adding a 'nopin' attribute to the images, but they were unable to do so as the images were added by the theme or translation plugin.
Solution:
We recommend considering a different approach since custom code modifications can be lost with future updates. The plugin that adds the button should ideally provide an option to exclude certain images or site areas from having the button applied. Alternatively, the client could switch to using language names or abbreviations instead of flags. If the client is not comfortable with coding, we suggest hiring a WPML contractor from https://wpml.org/contractors or a developer to implement the required changes. It is important to save any custom code and know where to reapply it after updates to avoid losing the modifications.

Please note that this solution might be outdated or not applicable to your case. If this doesn't resolve your issue, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket with us.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Mihai Apetrei 1 year, 9 months ago.

Assisted by: Mihai Apetrei.

Author Posts
February 16, 2024 at 11:52 am #15311379

carloC-19

Hi there,

I need to add a code for the "pin it button" to not appears on the language flag on my website. Please see the attached picture to see the problem.

I already contacted the "pin it" button developer and they told me the following:

"Thanks for reaching out about this. It looks like your language flag image is being added directly by your theme or translation plugin.

The Pin button is showing on this image because Tasty Pins can't modify the code for this image to prevent the hover button.

Basically, to prevent those pin buttons from showing up, we need to add the nopin attribute to the image as described by Pinterest here: hidden link

Since Tasty Pins can't modify the images added by your theme or other plugins, we can't add that attribute. Can you contact the plugin or theme author and request that they add the nopin attribute to those images it adds? This is generally an easy update for plugin authors to make."

Best regards,

Carlo Cao

Screenshot 2024-02-12 at 10.51.08.png
February 16, 2024 at 11:12 pm #15313284

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi there.

You could definitely add what they said inside the code of our plugin or the code of the site (custom code falls out of the scope of our Support Policy) but that means that you will need to re-add that code whenever you update WPML to a new version (when that's available).

So, to be honest, my opinion is that this should be better planned on their side as they are the plugin that's offering that functionality.

Here's the way I think about this:

If you create a plugin that adds a button on each existing image on the site so that it can be shared online, then you have to also think that some people have hundreds of images on the site.

You should be able to implement a functionality that will give them the option to remove that button from specific areas of the site / or specific images.

This should be implemented in the plugin that's creating this functionality.

Another alternative would be to not use flags and use just the language names or abbreviations.

That's the best recommendation that I can make at this point, outside of recommending hiring a WPML contractor (https://wpml.org/contractors) or a developer in case you don't feel comfortable with coding and that person can do what they requested. But make sure that you save the code that person is creating and make sure that you know where you can add it on your own so that you have this for the future when you update WPML and the content might get overwritten.

I hope that you will find all that information helpful. 🙂

Mihai