×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
0
Language: PHP
Posted by: Vincenzo Assenza
Added: Jul 14, 2015 3:10 PM
Views: 16
  1. <!-- Start of Facebook Meta Tags by shailan (http://shailan.com) -->
  2.     <meta property="og:title" content="Introducing dropdown menu effects" />
  3.     <meta property="og:type" content="article" />
  4.     <meta property="og:url" content="http://shailan.com/introducing-dropdown-menu-effects/" />
  5.     <meta property="og:image" content="http://shailan.com/wp-content/uploads/wp-dropdown-menu-effects-thumbnail-200x200.jpg" />
  6.     <meta property="og:site_name" content="shailan.com"/>
  7.     <meta property="og:description" content="With the 1.6 update finally added jQuery effects to the dropdown menu widget. This version also brought many other features like, auto-recognizing dropdown.css in theme folder, specifiying an external theme URL, options for removing link..." />
  8. <!-- End of Facebook Meta Tags -->
  9.  
  10. Open the header.php
  11. Paste the following code before <?php wp_head(); ?>
  12.  
  13. <?php
  14. global $wp_query;
  15. $thePostID = $wp_query->post->ID;
  16. if( has_post_thumbnail( $thePostID )){
  17.     $thumb_id = get_post_thumbnail_id( $thePostID );
  18.     $image = wp_get_attachment_image_src( $thumb_id );
  19.     echo '<meta property="og:image" content="'.$image[0].'" />';
  20. } ?>