Last active
August 29, 2015 14:03
-
-
Save jessehs/922f4f06583dfac4fd04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Twitter widget embedded in block. --> | |
<a class="twitter-timeline"data-dnt="true" data-tweet-limit="5" href="https://twitter.com/jessetweet" data-widget-id="479455834242445314">Tweets by @jessetweet</a> | |
<!--Twitter widget script is attached in the footer.--> | |
<?php | |
/** | |
* Override or insert javascript on the site. | |
* | |
* @param (array) $js | |
* An array of all JavaScript being presented on the page. I can't figure out why it won't show up if I attach it in the footer. | |
*/ | |
function MYTHEMENAME_js_alter(&$js) { | |
// Process Twitter widgets. | |
drupal_add_js('!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?"http":"https";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");', array('type' => 'inline', 'scope' => 'header')); | |
$path = drupal_get_path('theme', 'MYTHEMENAME'); | |
// Customize the look of the Twitter widget. (See https://github.com/kevinburke/customize-twitter-1.1.) | |
drupal_add_js($path . '/js/customize-twitter-1.1.min.js'); | |
drupal_add_js('var options = {"url": "/' . $path . '/css/twitter.css"};CustomizeTwitterWidget(options);', array('type' => 'inline', 'scope' => 'header')); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment