The link you have to make to share something to Twitter is quite simple:
http://twitter.com/share?text=text goes here
But getting a URL and hastag in there is a different matter. To be honest most developers do know how to include the URL, but hashtags have proved more elusive!
http://twitter.com/share?text=text goes here&url=http://url goes here&hashtags=hashtag1,hashtag2,hashtag3
Here’s an example to try out:
http://twitter.com/share?text=Here’s an awesome tip!&url=https://peter.mahoneywebmarketing.com/make-a-share-on-twitter-link-with-url-and-hashtags/&hashtags=peter,is,awesome
And that’s it!
Just what I was looking for. Thanks!
Greetings! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My web site looks weird when viewing from my iphone4. I’m
trying to find a theme or plugin that might be able to
resolve this problem. If you have any recommendations, please share.
I sure do!
Forget plugins, ideally you want responsive CSS so the same site delivers the appropriate layout to any device.
Thanks so much! This was just what I was looking for 🙂
Perfect! Exactly the tweet link I wanted.
The Twitter share code works perfectly.
thanks a lot. Exactly what is was looking for. Twitter Share Code worked Properly.
Do you happen to know a way to share shortlinks this way? The URL does not show up in the tweet when you don’t add a HTTP/HTTPS.
Short and sweet! Just what I need. Thanks!
Your code is working perfectly but do you have any idea why my site’s logo is not appearing in the tweet, it is displaying default images instead of the site logo in the tweet.
It’ll grab whatever the default image is on your page. Ideally you’d use Twitter card meta tags to set that sort of thing to whatever you prefer it to be.