/tweetable-text

A WordPress plugin that lets you choose specific phrases or sentences for one-click tweeting.

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

tweetable-text

A WordPress plugin that lets you choose specific phrases or sentences for one-click tweeting.

Based on Tweetable Text by Salim Virani, with additions by Joshua Benton of Nieman Lab.

Lets you highlight specific parts of a WordPress post for one-click tweeting. Use:

Schardt says that [tweetable]finding creative journalists with an awareness of what technologies are available to them is half the battle.[/tweetable] The advancements themselves outpace the average newsroom's awareness and ability, but funding continues to be overwhelmingly aimed at furthering these platforms — while journalists struggle to keep up.

Optionally, you can include an alt tag in the shortcode if you want the text of the tweet to be different than the exact text you're highlighting:

Schardt says that [tweetable alt="This is actually the text that will show up in the tweet."]finding creative journalists with an awareness of what technologies are available to them is half the battle.[/tweetable] The advancements themselves outpace the average newsroom's awareness and ability, but funding continues to be overwhelmingly aimed at furthering these platforms — while journalists struggle to keep up.

You can also add hashtags to the tweet:

Schardt says that [tweetable hashtag="#journalism #publicmedia"]finding creative journalists with an awareness of what technologies are available to them is half the battle.[/tweetable] The advancements themselves outpace the average newsroom's awareness and ability, but funding continues to be overwhelmingly aimed at furthering these platforms — while journalists struggle to keep up.

Or add an @username to use as the "via" source of the tweet:

Schardt says that [tweetable via="aschweig"]finding creative journalists with an awareness of what technologies are available to them is half the battle.[/tweetable] The advancements themselves outpace the average newsroom's awareness and ability, but funding continues to be overwhelmingly aimed at furthering these platforms — while journalists struggle to keep up.

As written, this requires Font Awesome for the Twitter bird; if you don't want to use Font Awesome, just delete &thinsp;<i class='icon-twitter' style='color: #ed2e24;'></i>. (You can replace it with an image call if you'd like.) Colors and other layout choices are editable in the CSS block at the bottom of the file.

Customize

alt tag

You can customize the colors, the link text, the background of the link and the hover state to match your web sites.

You can also add your Twitter handle so tweets show up via you.

TODO

  • Check user capabilities for settings
  • Add javascripty live preview to settings page
  • Need better labeling on settings page
  • Improve bitly shortening for links (check for valid API credentials on options page save)
  • Move admin-only settings into separate class
  • Need to add hack to stop no tables error when plugin is activated
  • Add documentation for contributing, hacking and customization
  • Submit pull request to jbenton