Sharethis

  • sylvia

    #3148

    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

    Anonymous

    #23572

    Have you tried the “Social Sharing Buttons” option in the admin panel?

    Appearance -> Graphene Options -> Social Sharing Buttons

    soapy

    #23573

    Same result Josh. Any idea how to make this work?? I tried following the instructions in the link from my previous post….but it just isn’t working. Very frustrating!

    Anonymous

    #23574

    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.

    soapy

    #23575

    Ok…so one question though….if I start with the basic HTML and JavaScript….I should be able to paste this in a text widget inside of an action hook, correct?

    Anonymous

    #23576

    Absolutely.

    soapy

    #23577

    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

    Kenneth John Odle

    #23578

    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.

    soapy

    #23579

    Ken, thank you very much! You were correct….I installed the php code widget plugin….everything works great!

    Josh, thank you as well!

    Anonymous

    #23580

    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.

Do NOT follow this link or you will be banned from the site!