I have been working on some code for a site that’s integrating a lot of social media links, and everything was going swimmingly until I noticed that the “Post to Twitter links were no longer working.
It turns out Twitter has made a few changes, but the fix was very easy.
All that was required to fix up the links was to replace instances of
Then, if you’re using PHP, you’ll want to get the variable that defines the current page:
<?php $pageURL = $_SERVER[“SERVER_NAME”].
And then finally, you can put that variable into your twitter link:
<a href=”http://twitter.com/intent/tweet?text=your+text+here+http%3A%2F%2F<?php echo $pageURL; ?>”>
And, YAY! It works.