Sharethis
-
Trying to manually implement sharethis instead of using the automatic option with the plugin to give me a little more customization. Having a hard time getting it right…can someone point out my mistakes? In the plugin settings, I can see the html and javascript code. It is:
<span class='st_twitter_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_facebook_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_fblike_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span>and
<script charset="utf-8" type="text/javascript">var switchTo5x=true;</script><script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'wp.553a5702-b76c-5867-bb71-fbcfc88f72dd'});var st_type='wordpress3.3.1';</script>I took this code and pasted it in text widget, which was placed inside the graphene_after_post_content action hook. The buttons showed up but they did not function properly….when clicked, they would create a link….and that link would only show a blank screen instead of showing my content.
I also got this answer from the sharethis forum…but it is somewhat vague:
http://forums.sharethis.com/topic.php?id=78401
Is someone able to help me here?
Thanks
Have you tried the “Social Sharing Buttons” option in the admin panel?
Appearance -> Graphene Options -> Social Sharing Buttons
It looks like you have customized your code beyond necessary means. I’m not even sure where all that code came from. Try using the basic default code provided from sharethis. Then, once you get that working, you can begin to customize it.
Absolutely.
Josh, sorry, another question….sharethis states that I need to put my ‘script tags’ in my Main index template(index.php) and ‘span tags’ in Single Post template(single.php). How do I do this? Just add the loop-single action hook and the graphene-index action hooks? And then add text widgets within the action hooks? (I don’t want to directly edit any php template files)
Mod
Looking at the code you provided above, I see that it contains php. That may explain why it doesn’t display properly when embedded in a text widget. You may want to try adding this code to a PHP widget, instead.
You’re welcome.
Thanks Ken.
(Marking Thread as Resolved)
Viewing 10 posts - 1 through 10 (of 10 total)
- You must be logged in to reply to this topic.
