FB Thumbnail
-
Hello,
Great plugin! Thanks for your time. I want to use it to show a different thumbnail at Facebook. Here’s the code that I am using right now to show the FB thumbnail:if ( has_post_thumbnail($post->ID) AND !(is_home()) ) { $imgfb = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); echo "<meta property=\"og:image\" content=\"$imgfb\" /> ";
How can I say that it should show the second thumbnail if the post has got one otherwise show the fist one. I was trying something link this but it doesn’t work:
if ( kdmfi_the_featured_image($post->ID) AND !(is_home()) ) { $imgfb = wp_get_attachment_url( get_post_thumbnail_id2( $post->ID ) ); echo "<meta property=\"og:image\" content=\"$imgfb\" /> "; else ( has_post_thumbnail($post->ID) AND !(is_home()) ) { $imgfb = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); echo "<meta property=\"og:image\" content=\"$imgfb\" /> ";
Thanks in advenaced!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘FB Thumbnail’ is closed to new replies.