Documentation Twitter and WordPress.com

Twitter and WordPress.com

Overview #

Twitter can be integrated in multiple ways with your WordPress.com VIP site:

  • Pushing out content updates.
  • Integrating Twitter updates in your site’s theme.
  • Providing your users a quick way to Tweet/share your site’s content.

↑ Top ↑

WordPress.com Publicize #

In addition to sending your content updates to Facebook and Yahoo!, the WordPress.com Publicize feature also supports Twitter updates. A full description of the feature can be found at the Publicize WordPress.com Support page.

WordPress.com VIPs can further customize how Publicize works by following our customization guide.

↑ Top ↑

The Twitter Widget #

The Twitter widget allows you to display updates from a Twitter account in the sidebar of your blog. It creates an unordered list whose look and feel can be easily altered using CSS.

A full description of this widget can be found at the Twitter Widget WordPress.com Support page.

↑ Top ↑

/via in Tweets #

If you’re using the built-in WordPress.com Sharing buttons, we have a helper function to customize the “/via” tag appended to Tweets. Just add the following to your functions.php and change the argument to the username you want attributed.

wpcom_vip_sharing_twitter_via( 'automattic' );

If you want to disable the “/via”, just pass in false:

wpcom_vip_sharing_twitter_via( false );

↑ Top ↑

Twitter Cards #

To automatically add Twitter Cards support for your site, just use our Open Graph Tags. We’ll add some additional metadata including some user-specific info if you’re using Publicize.

You can customize the output of the tags using the jetpack_open_graph_tags filter:

function my_add_twitter_card_extras( $tags ) {
	$tags[ 'twitter:site' ] = '@automattic'; // set @username of website
	return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'my_add_twitter_card_extras' );

↑ Top ↑

The Twitter API #

Need to interact with the Twitter API? Check the WP Codebird library included in our Shared Libraries.