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.

Help adding Tweet Button to Wordpress

Discussion in 'WordPress' started by That-Guy, Aug 24, 2010.

  1. #1
    OK I am trying to add the Twitter Button to my Wordpress Blog which is here:

    http://www.chrislowthian.co.uk

    The code I am using is this:

    <a href="http://twitter.com/share" rel="nofollow" class="twitter-share-button" data-url="<?php the_permalink() ?>" data-count="vertical" data-via="chrislowthian">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    Code (markup):
    I have added the code to the following pages:

    - index.php
    - single.php
    - archive.php

    The tweet button now shows up on the post pages, the homepage and the category pages.

    The problem is the tweet button only tweets the correct url and page title when you click on it on the post pages.

    When clicking it on one of the category pages or index page it just tweets the current page url and title and not the posts details that it is next to.

    Anyone know what I should change the code to for it to work on category and index pages?

    Thanks
     
    That-Guy, Aug 24, 2010 IP
  2. That-Guy

    That-Guy Peon

    Messages:
    452
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    All fixed now was missing the following:

    data-text="<?php the_title(); ?>"
    Code (markup):
     
    That-Guy, Aug 24, 2010 IP
  3. appstacks

    appstacks Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    To enable the button on your blog please visit the “Appearance > Extras” menu and select the “Show a Twitter Tweet Button on my posts” option.
     
    appstacks, Aug 26, 2010 IP
  4. khaxan

    khaxan Peon

    Messages:
    78
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    @appstacks I think the "Appearance > Extras" menu is not wordpress default
     
    khaxan, Aug 26, 2010 IP
  5. That-Guy

    That-Guy Peon

    Messages:
    452
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That is for Wordpress.com Users, my blog is Self Hosted.
     
    That-Guy, Aug 26, 2010 IP
  6. WallaceYeung

    WallaceYeung Notable Member

    Messages:
    3,377
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    230
    Digital Goods:
    1
    #6
    i have checked your blog, the problem was solved, right?! :)
     
    WallaceYeung, Aug 26, 2010 IP
  7. That-Guy

    That-Guy Peon

    Messages:
    452
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes Thank You all sorted now :)
     
    That-Guy, Aug 27, 2010 IP