Stann
Stann

Reputation: 13958

Difference between twitter share buttons

I simply want to add couple share button onto my page. And I see that people recommend different ways of doing it:

I see some articles using home?status:

<a href=”http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>” title=”Click to send this page to Twitter!” target=”_blank” rel=”nofollow”>Share on Twitter</a>

and some using share?url:

<a href="http://twitter.com/share?url=http%3A%2F%2Fdev.twitter.com%2Fpages%2Ftweet-button" target="_blank">Tweet</a>

What's the difference?

Upvotes: 0

Views: 397

Answers (1)

Chamilyan
Chamilyan

Reputation: 9423

Your first example simply updates the status with the text you enter. The second example has a lot more functionality.

share?url supports class attributes for the anchor tag. In the anchor tag you can add things like data-related to suggest accounts the user will follow after they share the content or if you don't supply a url it will look for the current url the call is being generated from and share that. It has a lot more functionality vs the dumbed down home?status call.

find more here: https://dev.twitter.com/docs/tweet-button

Upvotes: 2

Related Questions