Support » Plugin: Jetpack by » Custom og:image for homepage not working

Viewing 3 replies - 1 through 3 (of 3 total)
  • I added in the code for the custom Twitter tag which did work but the custom image did not.

    Plugin Name: Matts OG:image fallback
    Plugin URI:
    Description: Functionality plugin to add default open graph image to homepage when no featured image found. Also adds @FromeFM to a Twitter meta tag. Requires Jetpack. Code from
    Version: 0.4
    Author: Matt Sims, Automattic
    Author URI:
    function fb_home_image( $tags ) {
        if ( is_home() ) {
            // Remove the default blank image added by Jetpack
            unset( $tags['og:image'] );
            $fb_home_img = '';
            $tags['og:image'] = esc_url( $fb_home_img );
        return $tags;
    add_filter( 'jetpack_open_graph_tags', 'fb_home_image' );
    function tweakjp_custom_twitter_site( $og_tags ) {
    	$og_tags['twitter:site'] = '@FromeFM';
    	return $og_tags;
    add_filter( 'jetpack_open_graph_tags', 'tweakjp_custom_twitter_site', 11 );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Resolved. Was a simple case of a misplaced }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom og:image for homepage not working’ is closed to new replies.