enable hovercards in functions.php


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



Copy this code and paste it in your HTML
  1. $api_key = "your API-KEY here";
  2. wp_enqueue_script("twitter-anywhere",
  3. "http://platform.twitter.com/anywhere.js?id={$api_key}&v=1");
  4. add_action("wp_head", "twitter_anywhere");
  5.  
  6. function twitter_anywhere()
  7. {
  8. echo '<script type="text/javascript">';
  9. echo 'twttr.anywhere(onAnywhereLoad);';
  10. echo 'function onAnywhereLoad(twitter) { twitter.hovercards(); }';
  11. echo '</script>';
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.