Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save champsupertramp/4bb6cf8032deae33370b3e9af7111a4c to your computer and use it in GitHub Desktop.
Save champsupertramp/4bb6cf8032deae33370b3e9af7111a4c to your computer and use it in GitHub Desktop.
Ultimate Member - Make Thumbnail image show in Social Media sites posts
function um_custom_profile_dynamic_meta_desc() {
global $post;
$image_id = get_post_thumbnail_id( $post->ID );
$image_url = wp_get_attachment_image_src( $image_id, 'thumbnail', true ); ?>
?>
<meta property="og:image" content="<?php echo esc_url( $image_url ); ?>"/>
<?php
}
add_action( 'wp_head', 'um_custom_profile_dynamic_meta_desc', 9999999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment