Create a Tweet This link without JavaScript

What do I want?

A pure HTML solution, no JavaScript required to allow my readers to tweet a post. In my case I want to do it with WordPress but today's solution can be used anywhere 😉

How?

Creating a regular link pointing to:

More on Twitter Web Intents

Use WordPress functions for title and URL

Encode for URL and make sure characters look good

Your title might have characters that won't work well with just urlencode() function. Let's mix it:

Final output

The whole thing, including an inline SVG for the Twitter icon:

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*