Support » Fixing WordPress » Add "via @username" to Tweet button? Using JetPack for WordPress

  • Hi all! Right now, when a reader clicks Tweet on my post, they see “Post name: Long URL” to share. How can I change that to “Post name | Shortened URL via @twittername”?

    I’m using JetPack’s social sharing service which I think uses ShareDaddy? Any help is appreciated.

Viewing 7 replies - 16 through 22 (of 22 total)
  • Hey guys, I just switched to AddThis. These features are built in already, and it works way better than Jetpack’s.

    Try it out!
    http://wordpress.org/extend/plugins/addthis/

    No, I didn’t change anything else jsandlund!

    It’s just a about to add manually
    the part of the adress that uses twitter:

    https://twitter.com/intent/tweet?via=HERETHEUSERNAME&text=HERETHETITLE&url=HERETHEURL

    I found a workaround in line 331 of sharing-sources.php, i don’t know how to do this through my theme though. Anyone know the answer?:

    Original:

    function sharing_twitter_via( $post ) {
    		// Allow themes to customize the via
    		return apply_filters( 'jetpack_sharing_twitter_via', '', $post->ID );
    	}

    New (Twitter name where I have put “USERNAME” but no @ sign:

    function sharing_twitter_via( $post ) {
    		// Allow themes to customize the via
    		return apply_filters( 'jetpack_sharing_twitter_via', "USERNAME", $post->ID );
    	}

    Does anyone have a solution to the other part of the original post – i.e. shorterned url in the tweet? Can we somehow use the wp.me shortlink?

    B.

    (@bandonrandon)

    I refuse to edit core plugin files unless absolutly nessary. There is another way to go about it by adding a new service with the via attributed added. Here is what I did:

    After revewing Twitters API for links I went to the sharing settings selected add new service, named it then added the link https://twitter.com/share?text=%post_title%&url=%post_url%&via=USERNAME

    For the icon I used the default sharedaddy one located at ‘plugins/jetpack/modules/sharedaddy/images/twitter.png’

    This seems to work and shouldn’t break with updates

    Great find Bandon, worked like a champ.

    FYI: The only problem with BrandonRandon’s find is it won’t show the count. If you are looking for a count you may have to hack the plugin code, which as mentioned, would be impacted when updating the plugin.

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Add "via @username" to Tweet button? Using JetPack for WordPress’ is closed to new replies.