Skip to content

Instantly share code, notes, and snippets.

@davekellam
Last active December 31, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davekellam/8032150 to your computer and use it in GitHub Desktop.
Save davekellam/8032150 to your computer and use it in GitHub Desktop.
Modify Jetpack's Open Graph Output
<?php
/**
* Modify Jetpack's Open Graph Output
*/
function ef_og_tweaks( $tags ) {
if ( is_home() ) {
// Remove the blank image
unset( $tags['og:image'] );
$ef_og_home_img = 'YOUR_IMAGE_URL';
$tags['og:image'] = esc_url( $ef_og_home_img );
}
return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'ef_og_tweaks' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment