Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Tweet Construction When Sharing

Discussion in 'Misc WordPress Requests' started by bangsthought, Nov 14, 2017 at 4:43 PM.

  1. bangsthought

    Guest

    Tweet Construction When Sharing, by bangsthought

    Hi All,

    I have a bit of a niggle on my website. When using the twitter share button on my site it will construct the tweet in this format:


    Ralf Little Destroys Jeremy Hunts Lies On The Andrew Marr Show via @bangsthought https://bangsthought.com/ralf-little-destroys-jeremy-hunts-lies-andrew-marr-show/

    I would like it like this in the traditional format where the via @bangsthought is at the end:


    Ralf Little Destroys Jeremy Hunts Lies On The Andrew Marr Show https://bangsthought.com/ralf-little-destroys-jeremy-hunts-lies-andrew-marr-show/ via @bangsthought

    I have found the code that contructs this but I’m having issues changing it, I have tried to change it several different ways but it screws the whole post on the page. This is the original code:

    'twitter' => array(
    'url' => 'https://twitter.com/intent/tweet?text='. $post_title . $share_twitter_username .'&url='. $post_link,
    'text' => esc_html__( 'Twitter', 'jannah' ),
    ),

    This is the code for this part $share_twitter_username:

    # Twitter username ----------
    $share_twitter_username = jannah_get_option( 'share_twitter_username' ) ? ' via %40'.jannah_get_option( 'share_twitter_username' ) : '';

    Hope this makes sense and hope someone can help.

    Tweet Construction When Sharing
     
    #1

Share This Page

Web Hosting