Like Button on Wordpress: Additional Header code

/ Published in: HTML
Save to your folder(s)

If you are using Simple Facebook Connect Wordpress plugin, it is better to add this code after changing the og:image value or deleting it. Using this code in your Wordpress Theme header will result in having more meaningful information shown in Facebook profile for anyone clicking the button.
Not having this code will result in having every and any liked article show as the same in the visitors Facebook profile. For example, if a visitor likes 4 different articles they will show the same info on his Facebook profile, which is really useless and repititive.

Copy this code and paste it in your HTML
  1. <meta property="og:title" content="<?php the_title(); ?>"/>
  2. <meta property="og:site_name" content="<?php bloginfo('name'); ?>"/>
  3. <meta property="og:image" content="URL to Post Thumbnail if you are using custom field or remove the line"/>
  6. If you are using a custom-field for posts thumbnails, you may use this (change the name of the custom field, in this case being thumbnail):
  8. <meta property="og:image" content="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>"/>


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.