I am stuck. I posted this on WordPress.StackExchange plus they recommended I attempt at WebApps.StackExchange, plus they recommended I attempt here. So, apologies for that multiple posts should you follow all individuals!

I've got a client blog using bit.ly professional to create custom short web addresses (ie foo.co). I wish to show the standard horizontal version from the Twitter button, with tweet-count, and also have the link that would go to the publish use their custom bit.ly professional url.

I've installed Joost de Valk's Bit.ly Shortlinks plugin, which effectively converts normal Wordpress shortlinks (wp_get_shortlink()) towards the custom Bit.ly professional URL elsewhere within the site, but Twitter appears to trump might render everything using the default t.co domain rather.

I have checked out the suggestions from this question but while using # because the data-url does not work, and also the recommended Twitter support pages don't appear to contain any info regarding how to get Bit.ly to operate (though they are saying they are likely to).

Here's the function I produced to place the button during my theme - any applying for grants where I am failing? this really is accustomed to place the button both inside the Loop as well as on single-publish pages.

function tweet_this() {
    global $post;
    ob_start();
    $tweet = wp_get_shortlink();
    echo '<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script><a href="http://twitter.com/share" class="twitter-share-button" data-url="' .  $tweet . '" data-counturl="' . $tweet . '" data-count="horizontal" data-via="clietname" data-text="' . get_the_title() . '">Tweet</a>';
    return ob_get_clean();  
}

Just in case it will help, this function does work, except it does not render the tweet-count:

function tweet_this() {
    global $post;
    ob_start();
    $tweet = sprintf( __('%1$s %2$s'), $post->post_title, wp_get_shortlink() );
    echo '<a class="tweethis" href="http://twitter.com/intent/tweet?text=' . urlencode( $tweet ) . ' via @clientname">Tweet this</a>';
    return ob_get_clean();  
}

Tell me if you want more information - and thanks ahead of time for just about any assist you to can throw my way! Michelle

function tweet_this() {
    global $post;
    $tweet = get_permalink(); //replace with your code
    $tweetmarkup =  '<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script><a href="http://twitter.com/share" class="twitter-share-button" data-url="' .  $tweet . '" data-counturl="' . $tweet . '" data-count="horizontal" data-via="clietname" data-text="' . get_the_title() . '">Tweet</a>';
    echo $tweetmarkup;  
}

This works best for me, however i not have the WPShortlinks installed, and so i changed it using the permalink. You need to have the ability to replace the permalink together with your wordpress_get_shortlink also it should work.