Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   Stop Javascript From Loading? (http://forum.bytesforall.com/showthread.php?t=20277)

theadventurebite May 7, 2013 09:24 AM

Stop Javascript From Loading?
 
I have what I hope is a quick question. I running into a bit of a javascript problem I'm not sure how to handle.

I have several different Pinterest options on the blog. The overlaid one for images, the sharing button at the bottom of each post and the little "pin it" buttons in my sidebar with the counters.

I manually created the sharing buttons at the bottom of the posts with this:

Code:

<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘single-post-thumbnail’ ); ?>
<?php echo $image[0]; ?>
<?php endif; ?>&description=<?php the_title() ?>"><img src="http://farm9.staticflickr.com/8398/8693188926_538082c90a_t.jpg"/></a>

Which worked great until I added the buttons in the sidebar and the accompanying javascript that they require.
When I add this to the page:

Code:

<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
It makes all the Pin It buttons work but it changes my pretty little button at the bottom of the post into the Pin It button too.

I'm wondering if I can let it load the javascript for everything but that little button somehow?

This code does work for allowing the image to be custom:

Code:

<a href='javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;http://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());'><img src='http://farm9.staticflickr.com/8398/8693188926_538082c90a_t.jpg'/></a>
But it does not allow me to specify the photo to pin or a description which I would prefer to be able to do.

Help?


All times are GMT -6. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.