{"id":3726,"date":"2013-07-22T23:27:00","date_gmt":"2013-07-23T03:27:00","guid":{"rendered":"http:\/\/sahd.lamafam.org\/?p=3726"},"modified":"2013-07-22T23:27:00","modified_gmt":"2013-07-23T03:27:00","slug":"new-and-improved-twitter-widget","status":"publish","type":"post","link":"https:\/\/sahd.lamafam.org\/?p=3726","title":{"rendered":"New and Improved Twitter Widget"},"content":{"rendered":"<p>I&#8217;ve been aware that my Twitter feed was not working.  Twitter deprecated their original API and that pretty much killed the stock widget that my theme, Mystique, provided.  I knew what need to be done to make it work again, but I never could find the time needed to sit down and work it out.  Such is the life of an at-home Dad.<\/p>\n<p>Thankfully, I&#8217;m not the only WordPress user out here on the Interwebs.  I&#8217;m also not the only Mystique theme user.  I checked in at the theme author&#8217;s web site to see if there might be anything in the works.  There, I came across <a href=\"http:\/\/digitalnature.eu\/topic\/twitter-api-v1-1-solution\/#post-6801\">this<\/a> forum posting.  The topic title pretty much says it all.<\/p>\n<p>So that lead me to <a href=\"http:\/\/wordpress.org\/plugins\/twitget\/\">Twitget<\/a> which I&#8217;ve determined is a perfectly delightful little widget that does exactly what is needed.  It handles the credential side of Twitter and grabs all the desired info to build a Twitter widget.  Even more impressively, it provides an area within it&#8217;s settings to completely customize the look of the tweets.<\/p>\n<p>I started with the coding concoction from the forum link, and then slowly molded it into the following framework:<\/p>\n<pre><code>&lt;div class=\"latest-tweets\"&gt;\n&lt;div class=\"info box clear-block\"&gt;\n    &lt;div class=\"avatar\"&gt;\n        &lt;img width=\"48\" height=\"48\" src=\"{$profile_image}\" alt=\"{$user_real_name}\" \/&gt;\n    &lt;\/div&gt;\n    &lt;div class=\"details\"&gt;\n        &lt;a href=\"http:\/\/www.twitter.com\/{$user_twitter_name}\/\" title=\"\"&gt;@{$user_twitter_name}&lt;\/a&gt;\n        &lt;span class=\"followers\"&gt; {$follower_count} followers&lt;\/span&gt;\n    &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;ul class=\"tweets box\"&gt;\n    {$tweets_start}\n    &lt;li class=\"entry first\"&gt;{$tweet_text}\n    &lt;ul class=\"twitter_social\"&gt;\n        &lt;li class=\"tweet_date\"&gt;&lt;a href=\"{$tweet_link}\" rel=\"nofollow\"&gt;{$tweet_time}&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li class=\"twitter_reply\"&gt;&lt;a title=\"Reply\" href=\"{$reply_link}\" rel=\"nofollow\"&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li class=\"twitter_retweet\"&gt;&lt;a title=\"ReTweet\" href=\"{$retweet_link}\" rel=\"nofollow\"&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li class=\"twitter_fav\"&gt;&lt;a title=\"Favorite\" href=\"{$favorite_link}\" rel=\"nofollow\"&gt;&lt;\/a&gt;&lt;\/li&gt;\n    &lt;\/ul&gt;\n    &lt;\/li&gt;\n    {$tweets_end}\n&lt;\/ul&gt;\n<\/code><\/pre>\n<p>This snippet of HTML goes in a text box within Twitget&#8217;s settings page in the blog admin area.<\/p>\n<p>I also had to engage in some CSS magic to take care of the <strong>Reply<\/strong>, <strong>ReTweet<\/strong>, and <strong>Favorite<\/strong> buttons.  Well, I call it magic since it was a first for me using the technique.  Basically, I used a single PNG file with all of the necessary icons in it to generate the links, along with the hover effects.  Googling &#8220;css sprites png hover&#8221; should turn up plenty of useful examples.<\/p>\n<p>So a big thanks to the guys in the forum as well as Twitget&#8217;s author.  This solution integrates well with Mystique and makes for easier customization as well.  A solid solution all the way around.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve finally fixed the Twitter widget on the sidebar, now it&#8217;s<br \/>\nbetter than before.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[215,357,358,216],"class_list":["post-3726","post","type-post","status-publish","format-standard","hentry","category-admin","tag-mystique","tag-twitget","tag-twitter-widget","tag-wordpress-2"],"_links":{"self":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/posts\/3726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3726"}],"version-history":[{"count":0,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/posts\/3726\/revisions"}],"wp:attachment":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}