Skip to content

Instantly share code, notes, and snippets.

@bj-mcduck
Last active August 29, 2015 14:01
Show Gist options
  • Save bj-mcduck/89b55ff4ae2a69e2faa7 to your computer and use it in GitHub Desktop.
Save bj-mcduck/89b55ff4ae2a69e2faa7 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: REW Twitter Feed Copy
Description: Sidebar Twitter feed
*/
class RewTwitterFeedCopy extends WP_Widget
{
function RewTwitterFeed()
{
$widget_ops = array('classname' => 'RewTwitterFeed', 'description' => 'REW Twitter Feed Copy' );
$this->WP_Widget('RewTwitterFeedCopy', 'REW Twitter Feed Copy', $widget_ops);
}
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
?>
<a class="twitter-timeline" href="https://twitter.com/REWca" data-widget-id="385817024472952832">Tweets by @REWca</a>
<script>
!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");
</script>
<?php
echo $after_widget;
}
}
add_action( 'widgets_init', create_function('', 'return register_widget("RewTwitterFeedCopy");') );
?>
<?php
/*
Plugin Name: REW Twitter Test Feed
Description: Sidebar Twitter feed
*
class RewTwitterFeed extends WP_Widget
{
function RewTwitterFeed()
{
$widget_ops = array('classname' => 'RewTwitterFeed', 'description' => 'REW Twitter Feed' );
$this->WP_Widget('RewTwitterFeed', 'REW Twitter Test Feed', $widget_ops);
}
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
?>
<a class="twitter-timeline" href="https://twitter.com/REWca" data-widget-id="385817024472952832">Tweets by @REWca</a>
<script>
!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");
</script>
<?php
echo $after_widget;
}
}
add_action( 'widgets_init', create_function('', 'return register_widget("RewTwitterFeed");') );
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment