Tagged: Pinterest
-
AuthorPosts
-
October 17, 2018 at 10:42 am #1022674
I’ve added some code to some of my blog posts to add in the Pinterest Save button to images in my blog post, not just my featured image. This allows me to have Pinterest specific image sizes when the blog is saved to Pinterest.
But, this addition has now altered the Pinterest Share button in the default theme sharing buttons at the bottom of the blog post and now has a red bar partially across the share box. See link https://whizzkids-toys.co.uk/celebrate-success-with-a-balance-bike-licence/
The code I added to that particular blog post was from the Pinterest Developers
[av_button label='DOWNLOAD PRINTABLE BALANCE BIKE LICENCE' link='manually,https://whizzkids-toys.co.uk/wp-content/uploads/2018/07/Balance-Bike-Licence-.pdf' link_target='_blank' size='x-large' position='center' label_display='' icon_select='yes' icon='ue82d' font='entypo-fontello' color='theme-color' custom_bg='#444444' custom_font='#ffffff' av_uid='av-lawsx1' custom_class='' admin_preview_bg='']
<script async defer src=”//assets.pinterest.com/js/pinit.js”></script>Appreciate any help with this one.
Thanks,
kesdegOctober 18, 2018 at 12:55 pm #1023328Hey kesdeg,
Thank you for using Enfold.
Can we access the dashboard? I would like to check the pinterest script.
Where did you get the script? Please provide a reference or the documentation.Best regards,
IsmaelOctober 19, 2018 at 11:37 am #1023863Hi Ismael,
For sure, access to the dashboard is below in the private content.
Reference material for the script for the Pinterest Button addition is from here:
https://developers.pinterest.com/docs/widgets/save/Thanks
kesdeg
October 22, 2018 at 2:12 am #1024643Hi,
Thanks for the update.
I think you forgot the username. I’ve tried the usernames from your previous threads but they’re not working.
Have you tried using your own html code as described in the docs?<a href="https://www.pinterest.com/pin/create/button/" data-pin-do="buttonBookmark" data-pin-custom="true"> --YOUR CUSTOM HTML-- </a>
I guess the script targets every elements with the “pinterest” string in the href attribute.
You can use this css code to hide the theme’s pinterest button:
.av-share-link.av-social-link-pinterest { display: none; }
Best regards,
IsmaelOctober 23, 2018 at 9:00 pm #1025619Thanks Ismael,
I had the code:
in my post from 18th October but very wierdly, that code seems to have disappeared. This created a Save button right underneath the tall image within the post and allowed the post to be saved to Pinterest using the tall image, not the featured image at the top of the post.I’ve restored this version but for some reason, I now can’t get it to work.
Login in the private section below:
October 24, 2018 at 3:32 am #1025765Hi,
You need to remove the “data-pin-custom=”true””. The html code should be:
<a href="https://www.pinterest.com/pin/create/button/" data-pin-do="buttonBookmark">Pinit</a>
I tried to add the pinit script in the funtions.php file but there are errors. Please add this code:
add_action( 'wp_enqueue_scripts', 'ava_enqueue_pinterest_script', 10 ); function ava_enqueue_pinterest_script() { wp_register_script( 'avia-pinit', 'http://assets.pinterest.com/js/pinit.js', array(), '', false ); wp_enqueue_script( 'avia-pinit' ); }
This is working properly on my end.
Best regards,
IsmaelOctober 24, 2018 at 12:58 pm #1025880Thanks very much Ismael, see that the Pinit button is now below the images.
Can you just clarify where I need to add the code add_action( ‘wp_enqueue_scripts’, ‘ava_enqueue_pinterest_script’, 10 ); etc…
In the functions.php file of the theme or the child theme?Thanks,
kesdegOctober 24, 2018 at 2:54 pm #1025920Hi,
You should add it in the child theme’s functions.php file. Use this css code to remove the theme’s pinterest button.
.av-share-link.av-social-link-pinterest { display: none; }
Or edit the includes > helper-social-media.php file, add the “nopin” attribute on line 236:
$this->html .= "<a nopin {$blank} href='".$share['url']."' ".av_icon_string($icon)." title='' data-avia-related-tooltip='{$name}'><span class='avia_hidden_link_text'>{$name}</span></a>";
This will exclude the default pinterest button from the script.
Best regards,
IsmaelOctober 26, 2018 at 10:40 am #1026692Thank you very much Ismael, you can now close this thread.
kesdeg
October 26, 2018 at 3:12 pm #1026833 -
AuthorPosts
- The topic ‘Pinterest Button Addition to Images on Blog Posts’ is closed to new replies.