Adding Shortlinks to WordPress Tweet Button Through Jetpack plugin

Harper Kingsley - Author of sci-fi and fantasy, loves to babble about books, movies, comics, and whatever

Okay, so I changed up my Twitter button on Jetpack so I could use a short link and add “Via HarperKingsley0″ my Twitter name. Took me about two minutes once I found out what I needed to do.


Go to Plugins => Installed Plugins => Jetpack => Edit => modules/sharedaddy.php => sharing-service.php. It should look like this “jetpack/modules/sharedaddy/sharing-service.php.”


Just click the code and run a Find for “Twitter” then scroll down until you find the code you need to change. Replace the “get_permalink” with “wpme_get_shortlink” and add “via=USERNAME&” after the frame address. Like this:


via=HarperKingsley0&url=’ . rawurlencode( apply_filters( ‘sharing_permalink’, wpme_get_shortlink( $post->ID ), $post->ID, $this->id ) ) . ‘&counturl=’ . rawurlencode( str_replace( ‘https://’, ‘http://’, wpme_get_shortlink( $post->ID ) ) ) . ‘&count=horizontal&text=’ . rawurlencode( apply_filters( ‘sharing_post_title’, $post->post_title, $post->ID, $this->id ) ) . ‘: ” style=”width:97px; height:20px;”>’;

else

return $this->get_link( wpme_get_shortlink( $post->ID ), _x( ‘Twitter’, ‘share to’, ‘jetpack’ ), __( ‘Click to share on Twitter’, ‘jetpack’ ), ‘share=twitter’ );

}


public function process_request( $post, array $post_data ) {

$post_title = apply_filters( ‘sharing_post_title’, $post->post_title, $post->ID, $this->id );

$post_link = apply_filters( ‘sharing_permalink’, get_permalink( $post->ID ), $post->ID, $this->id );


The only problem is that I don’t think my Tweet numbers are showing up correctly. Anyone know how to fix it and keep my short link and Twitter showing?


[ Found the Twitter user name info at site and the short link info at Skip's Stuff. I discovered both through a Google search; I have no affiliation with either. ]


The post Adding Shortlinks to WordPress Tweet Button Through Jetpack plugin appeared first on Harper Kingsley.
All content copyright HarperKingsley.net unless otherwise stated.
Please do not steal my words. In a hundred years they are all that will be left of me.

 •  0 comments  •  flag
Share on Twitter
Published on August 01, 2012 22:24
No comments have been added yet.


Sol Crafter's Blog

Sol Crafter
Sol Crafter isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Sol Crafter's blog with rss.