Support » Plugins » Help with Digg

  • Resolved Andrew Ledwith


    Hey friends,

    First of all, I am NOT using a plugin. I’m currently messing around with the javascript provided by Digg on their website. You can find it here:

    My problem is that I cannot make use of digg_bodytext the way I want to. Whenever I specify anything other than plain text for that field (i.e. a call to the_content or the_excerpt) the whole thing breaks (the button is no longer compact, the link no longer goes to the page I specify, the title is blank).

    Anyone have any advice for how to get digg_bodytext to play nice with digg_url, digg_title and digg_skin?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Do you have an example we can see? A link to a page where you’re attempting to use this code?

    Edit: After playing with it myself, I found that this works pretty well:

    <?php $bodytext = str_replace(chr(13),'',get_the_excerpt());
    $bodytext = str_replace(chr(10),'',$bodytext);?>
    digg_bodytext='<?php echo $bodytext; ?>';

    Javascript doesn’t like line breaks in string literals. This code removes any line breaks from the_excerpt and uses that.

    Stellar! That worked perfectly. Thanks Otto, you’ve been a big help.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with Digg’ is closed to new replies.