Categories
WordPress

Jetpack’s Publicize Now Uses Twitter Cards

A long time ago, Jetpack’s Publicize feature—which automatically posts to your social media platforms when you publish a new post—started attaching an image to your tweets to help them catch people’s attention.

At the time, a tweet with a picture would perform better than a tweet with just a link.

This is all fine and good, but a lot has changed since Jetpack started doing that. Twitter cards, if nothing else, not only were developed but were opened up to all (remember when you used to have to opt-in?). When you attach media, that’s the “special” part of your tweet. The Twitter Card, rendered from the meta tags on your post, is not displayed.

Today, effective for all versions of Jetpack and all WordPress.com sites, Publicize will no longer attach a picture to your tweet, instead allowing Twitter to display the Twitter card it renders.

If you want to return to the old way and are on Jetpack 8.5 (released today) or WordPress.com Business, you can add a small code snippet to change it.

add_filter( 'jetpack_publicize_options', function( $option ) { 
    $option['attach_media'] = true;
    return $option;
} );

This filter will, in the end, notify WordPress.com’s server of your preference and use it for future Publicize posts.

Questions about Jetpack’s Publicize feature? There is a team of Happiness Engineers ready to help!

Advertisements
Categories
Useful Things Web Development WordPress

Developing with Jetpack

At this very moment, I’m presenting at WordCamp DFW about using Jetpack in your development. It is meant to wet your appetite to think about Jetpack in, perhaps, a different way. Far from comprehensive, I’ll mention things not in the slides and still miss plenty.

Check out the Developing with Jetpack deck!

Categories
Code Snippets WordPress

Change the “Related” Headline in Jetpack’s Related Posts Feature

function kraft_related_posts_headline( $headline ) {
$headline = sprintf(
				'<h3 class="jp-relatedposts-headline"><em>%s</em></h3>',
				esc_html( 'Other Things You Should Read' )
			);
return $headline;
}
add_filter( 'jetpack_relatedposts_filter_headline', 'kraft_related_posts_headline' );

Easy way to switch out the “Related” header that is in the Related Posts module in Jetpack 2.9+.

Categories
Code Snippets WordPress

Jetpack Publicize with WooCommerce Products

add_action('init', 'kraft_woo_publicize');
function kraft_woo_publicize() {
  add_post_type_support( 'product', 'publicize' );
}

This code snippet, for your theme’s functions.php or in a core functionality plugin adds Jetpack’s Publicize feature to WooCommerce products. This would allow you to auto-post to Facebook, Twitter, Google+, etc when you post a new WooCommerce product to your site.

UPDATE: WooCommerce now includes Publicize support by default out of the box as of version 2.3.0. If you want to disable this feature, use the following code:

add_action('init', 'kraft_woo_publicize_remove');
function kraft_woo_publicize_remove() {
  remove_post_type_support( 'product', 'publicize' );
}
Categories
WordPress

Failed Commit

I laughed when I realized that I was wearing my Jetpack t-shirt when I misfired and committed something directly against the Jetpack repo today.