How to add a custom Open Graph image tag to your home page

When you share a post on Facebook, or when Jetpack Social auto-shares a post to your Facebook page, Facebook crawls the page and looks for Open Graph meta tags to build a complete post preview (with an image, title, description, …).

Jetpack automatically creates these meta tags for you, so you don’t have to worry about it!

Jetpack will also add an Image meta tag to your home page if you use a Site Logo, or a Site Icon. If you don’t use any of these 2 options, you might want to add your own custom image meta tag there. To do so, add one of the following code snippets to your theme’s functions.php file, or to a functionality plugin:

function fb_home_image( $tags ) {
	if ( is_home() || is_front_page() ) {
		// Remove the default blank image added by Jetpack
		unset( $tags['og:image'] );

		$fb_home_img = 'YOUR_IMAGE_URL';
		$tags['og:image'] = esc_url( $fb_home_img );
	}
	return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'fb_home_image' );

Alternatively, you can change the default image used any time Jetpack can not determine an image to use:

function custom_jetpack_default_image() {
	return 'YOUR_IMAGE_URL';
}
add_filter( 'jetpack_open_graph_image_default', 'custom_jetpack_default_image' );

It’s worth noting that the fallback image has to be larger than 200 x 200px, as per Facebook requirements. If your image is smaller, Facebook will ignore it.

Posted in Code snippets, Tips & Tricks | Tagged , | 1 Comment

Remove Jetpack’s Open Graph meta tags

If you’ve activated the Sharing or Jetpack Social modules, Jetpack will automatically add Open Graph meta tags to each one of your posts. These tags are used by Facebook to gather information about the post and build a post preview when one of your readers shares a post on Facebook.

If you already use another plugin to handle Open Graph meta tags on your site, we’ll automatically deactivate Jetpack’s Open Graph meta tags for you, to avoid any duplicates.

If, however, you’ve added these tags to your theme or built your own plugin, you’ll want to add the following code to your theme’s functions.php file or to your plugin, to deactivate Jetpack’s Open Graph meta tags:

add_filter( 'jetpack_enable_open_graph', '__return_false' );
Posted in Code snippets, Tips & Tricks | Tagged , , , | Comments Off on Remove Jetpack’s Open Graph meta tags

Jetpack 2.0: Publicize to Facebook, Twitter, LinkedIn, Tumblr; Post by Email; Photon; Infinite Scroll

The past nine releases of Jetpack have started to reveal our vision for next-generation features that will boost WordPress’ incredible success by making it more social, more connected, more mobile, and more customizable.

Over three million downloads later, we’re excited to report that the community has embraced this seemingly impossible vision for combining the best of hosted and non-hosted WordPress. This tenth release brings some of the most-asked-for features into the hands of millions of Jetpackers.

Publicize to Twitter, Facebook, LinkedIn, Tumblr…

You no longer have to jump through hoops and developer portals to connect your blog to your friends on your favorite social networks. Through Jetpack and your WordPress.com account, you can connect to each network with just a few clicks and broadcast to your audiences and followers across several networks, making WordPress your true digital hub. Activate Publicize from the main Jetpack page in your dashboard, then go to Settings → Sharing to add social sharing connections.

Post by Email

If you live in Gmail, Outlook, your BlackBerry, or just find it easiest to email on the go, you’ll love the new Post by Email feature. Email anything to your secret address — a photo, a video, a bunch of photos, an audio file, ten pages of single-spaced text — and we’ll figure out how to make it beautiful and put it on your blog literally within seconds after you send it. Combined with Publicize and the previously-released Subscriptions module, that post will go out to all your friends including ones that subscribe via email, completing the loop of email / blog nirvana. To set up your special address go to Users → Your Profile in your dashboard and click the “Enable Post By Email” button.

Photon Your Images

Have you ever switched themes to find that full-width images break out of the layout and no longer fit your theme? Are you frustrated that images on your blog take too long to load? Jetpack Photon fixes all of that by making the advanced image acceleration and image editing service from WordPress.com available to the broader WordPress community, essentially making every image a fully dynamic object that themes and plugins can transform to their heart’s content without killing your server. In fact, if you enable Photon, you will see your CPU and bandwidth usage plummet as images are served through the global WordPress.com cloud, meaning less load on your host and faster images for your users.

Infinite Scroll

Infinite Scroll brings the future of reading on the web to your website. Speed and performance are key, and Infinite Scroll loads new content quickly without a full-page refresh. Instead of the old way of navigating down a page — by scrolling and then clicking a link to get to the next page and waiting for the page to refresh — infinite scrolling pulls the next set of posts into view automatically when the reader approaches the bottom of the page. Your theme needs support for this to work. There are already several themes in the directory with Jetpack Infinite Scroll support and theme authors will find documentation for adding it to any theme on jetpack.me.

Onwards…

Jetpack 2.0 isn’t just about shiny new things, we’ve also fixed dozens of bugs and under-the-hood things to keep Jetpack one of the smoothest running, most secure, and most stable plugins out there.

I want to personally thank all of the members of the Jetpack community who have shared countless hours of testing, feedback, and criticism. Your thoughts and passion have made the plugin immeasurably better than it would have been otherwise, and rest assured we’re still listening closely to your feedback around better stats, module activation and deactivation, developer mode, translation, and documentation.

Posted in Jetpack News, Releases | Tagged , , , , , , , , , | 90 Comments
  • Enter your email address to follow this blog and receive news and updates from Jetpack!

    Join 112.5K other subscribers
  • Browse by Topic