Open Graph Image
-
I’m using a custom field, field type is image. I’m using a custom post type and I’ve tried everything to get this image field to show as the meta property=”og:image” but nothing works.
I’ve tried 4 or 5 snippets similar to this but non workadd_filter( ‘og_og_image_value’, ‘my_own_og_image_value’ );
function my_own_og_image_value( $value ) {
if ( is_admin() ) {
return $value;
}
if ( is_singular() ) {
$post_id = get_the_ID();
$cf = get_post_meta( $post_id, ‘speaker_image’, true );
if ( ! empty( $cf ) ) {
$value = $cf;
}
}
return $value;
}`
`The page I need help with: [log in to see the link]
- The topic ‘Open Graph Image’ is closed to new replies.