Last active
December 31, 2015 19:09
-
-
Save davekellam/8032150 to your computer and use it in GitHub Desktop.
Modify Jetpack's Open Graph Output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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