Forums

Add "via @username" to Tweet button? Using JetPack for WordPress (5 posts)

  1. adg3724
    Member
    Posted 4 months ago #

    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.

  2. adg3724
    Member
    Posted 4 months ago #

    Any ideas JarretC? :)

  3. adg3724
    Member
    Posted 4 months ago #

    Sorry for the bump, I need it asap :)

  4. Greg McMullen
    Member
    Posted 2 months ago #

    I've figured it out before, are you still looking for the answer?

  5. Greg McMullen
    Member
    Posted 2 months ago #

    You will want to edit this file: jetpack/modules/sharedaddy/sharing-sources.php

    return '<div class="twitter_button"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url=' . rawurlencode( apply_filters( 'sharing_permalink', get_permalink( $post->ID ), $post->ID, $this->id ) ) . '&counturl=' . rawurlencode( str_replace( 'https://', 'http://', get_permalink( $post->ID ) ) ) . '&count=horizontal&text=Via @USERNAME: ' . rawurlencode( apply_filters( 'sharing_post_title', $post->post_title, $post->ID, $this->id ) ) . ': " style="width:97px; height:20px;"></iframe></div>';';

    The tweet would then Read Via Username: TITLE OF THE POST: <URL>

    Hope this helps.

Reply

You must log in to post.

About this Topic