[Plugin: Multiple Post Thumbnails] Use secondary image for FB Open Graph
-
I’m using Facebook’s new WP plugin. It used the featured image in the Open Graph metadata. I’d like to change this to the secondary image. I’m a PHP novice and am not sure what to change in the following code. Thanks.
if ( post_type_supports( $post_type, ‘thumbnail’ ) && function_exists( ‘has_post_thumbnail’ ) && has_post_thumbnail() ) {
list( $post_thumbnail_url, $post_thumbnail_width, $post_thumbnail_height ) = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ );if ( ! empty( $post_thumbnail_url ) ) {
$image = array( ‘url’ => $post_thumbnail_url );if ( ! empty( $post_thumbnail_width ) )
$image[‘width’] = absint( $post_thumbnail_width );if ( ! empty($post_thumbnail_height) )
$image[‘height’] = absint( $post_thumbnail_height );$meta_tags[‘http://ogp.me/ns#image’%5D = array( $image );
}
}
}
The topic ‘[Plugin: Multiple Post Thumbnails] Use secondary image for FB Open Graph’ is closed to new replies.