Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

Stop Javascript From Loading?


  #1  
Old May 7, 2013, 10:24 AM
theadventurebite
 
136 posts · May 2010
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?

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop hover in menus jgmarsh Page & Category Menu Bars 2 May 3, 2013 02:44 PM
how to stop auto p studentofstone Atahualpa 3 Wordpress theme 1 Jan 26, 2012 01:28 PM
Posts page jumps down and around when loading - how do I stop it? tomsimone Center area post/pages 2 May 30, 2011 11:49 PM
Stop! Don't post in the 'HOW TO' forum if.... paulae Forum How-To 4 Oct 19, 2009 01:12 PM


All times are GMT -6. The time now is 12:19 AM.


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