1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to Create a DIGG Button

Discussion in 'Social Networks' started by keblack, Feb 2, 2007.

  1. #1
    Hi,

    I went to http://sandbox.sourcelabs.com/diggbutton/generate.php, to create a DIGG button for my website, but the javascipt code won't show up on my blog at http://weight-loss-discovery.com/weight-loss-news/

    I submitted my first DIGG story tonight at :

    http://digg.com/health/10_Top_Reasons_Why_You_Are_Overweight

    and I need to add the DIGG button to that story at my blog, but the javascipt button won't show up - I pasted it into the article after hitting the "Code" button and closed the tags. I saved it, but it won't show up.

    What am I doing wrong, or is there a better button generator ?

    Your help is appreciated.

    Thank you.
     
    keblack, Feb 2, 2007 IP
  2. inman

    inman Peon

    Messages:
    615
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey, yours is a WordPress blog. Why bother creating a digg button yourself, there are many plugins for WordPress that will do the job for you.

    For example I use this one,
    http://www.aviransplace.com/index.php/digg-this-wordpress-plugin/

    After installing the plugin correctly, goto your digg story and click on the story title to visit your site. The plugin will automatically detect the refer URL of digg and will add a digg button to your post.
     
    inman, Feb 3, 2007 IP
  3. keblack

    keblack Active Member

    Messages:
    137
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #3
    Thanks for the info., but I still can't get any button to show up. In the instructions it says :
    .....................
    How to install:
    Copy Digg this plugin to wordpress plugin folder and activate it.

    To use this, simply add <?php digg_this(); ?> or <?php digg_this_button(); ?> anywhere in your template (in “the loop“) you want to show the link back to digg.

    VERY IMPORTANT: Since dugg stories are linked to a single post you also HAVE TO put the digg_this() function in your single.php template, otherwise it will not recognize incoming links
    .............................................

    So, I did all that and it doesn't work for some reason - not sure what I'm doing wrong. In the important note does it mean you put : digg_this() in the single.php file or do you put <?php digg_this(); ?> in the single.php ?

    Also, where in single.php do you put it ?

    Any help is appreciated.
     
    keblack, Feb 3, 2007 IP
  4. inman

    inman Peon

    Messages:
    615
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Put it as <?php digg_this(); ?> in the single.php

    I packed it inside a layer so that it looks like the screenshot below

    [​IMG]

    The code I used for that is

    <div style="display:block;float:left;margin: 5px 5px 5px 5px;">
    <?php digg_this(); ?>
    </div>
    HTML:
    I placed it under the <?php the_title(); ?> in single.php. Try it yourself.
     
    inman, Feb 3, 2007 IP
  5. keblack

    keblack Active Member

    Messages:
    137
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #5
    Thanks for the tip, but it still won't work. Here is the code where I added it in the single.php file in Presentation-Theme Editor :

    ..............

    <h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>


    <div style="display:block;float:left;margin: 5px 5px 5px 5px;">
    <?php digg_this(); ?></div>

    <div class="entry">
    <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>

    ...................

    And here is the code in my page that I am digging :

    More importantly, talk with your doctor about your weight loss goals and ideas and get their approval first before embarking on any exercise or diet program. Before you know it, you will start feeling more energetic, healthier and more alive than ever before.

    <code><?php digg_this(); ?></code>


    <code><a href="http://www.jdoqocy.com/click-2289270-10419337" target="_top">
    <img src="http://www.tqlkg.com/image-2289270-10419337" width="468" height="60" alt="Biggest Loser Diet Club – Sign Up Now" border="0"/></a></code>

    ..........

    Any ideas what could be wrong ?

    Your help is appreciated very much.
     
    keblack, Feb 3, 2007 IP
  6. inman

    inman Peon

    Messages:
    615
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You need to add it only once i.e. in single.php. No need to do <code><?php digg_this(); ?></code> within every post.

    And looks like I made a small mistake in the code.

    In single.php, replace <?php digg_this(); ?> with <?php digg_this_button(); ?>
     
    inman, Feb 3, 2007 IP
  7. keblack

    keblack Active Member

    Messages:
    137
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #7
    Okay, thank you. I took it out of the post and added the code to the single php file and it still doesn't show up for some reason. Here's the code :

    <h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>

    <div style="display:block;float:left;margin: 5px 5px 5px 5px;"><?php digg_this_button(); ?></div>

    ..........

    So, there must be some setting somewhere that I have wrong, but I have no idea what it is. Are you using this same code ? And when you add it to the single.php file, it attaches a Digg button after every post or page you create ?
     
    keblack, Feb 3, 2007 IP