Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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,
    kesdeg

    #1023328

    Hey 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,
    Ismael

    #1023863

    Hi 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

    #1024643

    Hi,

    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,
    Ismael

    #1025619

    Thanks 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:

    #1025765

    Hi,

    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,
    Ismael

    #1025880

    Thanks 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,
    kesdeg

    #1025920

    Hi,

    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,
    Ismael

    #1026692

    Thank you very much Ismael, you can now close this thread.

    kesdeg

    #1026833

    Hi,

    Cool. We’ll close the thread now. Thank you for using Enfold! :)

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Pinterest Button Addition to Images on Blog Posts’ is closed to new replies.