{"id":4457,"date":"2014-05-17T10:38:14","date_gmt":"2014-05-17T10:38:14","guid":{"rendered":"http:\/\/demo.momizat.net\/goodnews\/?p=130"},"modified":"2014-05-17T10:38:14","modified_gmt":"2014-05-17T10:38:14","slug":"create-a-twitter-widget","status":"publish","type":"post","link":"https:\/\/bulandrashtrawadi.in\/?p=4457","title":{"rendered":"Create A Twitter Widget"},"content":{"rendered":"<p>How To Create A Twitter Widget for your WordPress Themes . Twitter needs no introduction.Wordpress Themes  It has become <em>the<\/em> way to reach audiences for some people and companies and a place to hang out for others. Placing a Twitter feed on one\u2019s website has almost become compulsory. Embedding a feed isn\u2019t all that difficult if you are comfortable with Twitter\u2019s default widget, but making your own will enable you to blend it into your website seamlessly.Wordpress Themes<\/p>\n<p><a href=\"http:\/\/media.mediatemple.netdna-cdn.com\/wp-content\/uploads\/2013\/06\/photodune-4052663-twitter-on-keyboard-xs_mini.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-109426\" src=\"http:\/\/media.mediatemple.netdna-cdn.com\/wp-content\/uploads\/2013\/06\/photodune-4052663-twitter-on-keyboard-xs_500_mini.jpg\" alt=\"photodune-4052663-twitter-on-keyboard-xs\" \/><\/a><\/p>\n<h3>The Result<\/h3>\n<p>The result of our effort will be a WordPress widget that can be placed in a widgetized sidebar. It will display the user\u2019s details on top and the latest few items from the user\u2019s feed. You can see it in action in our <a href=\"http:\/\/bonsaished.com\/musico\/about\/\">Musico<\/a> theme, although the screenshot below says it all.Wordpress Themes<\/p>\n<p><a href=\"http:\/\/media.mediatemple.netdna-cdn.com\/wp-content\/uploads\/2013\/06\/finished_widget_mini.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-108921\" src=\"http:\/\/media.mediatemple.netdna-cdn.com\/wp-content\/uploads\/2013\/06\/finished_widget_mini.png\" alt=\"finished_widget\" \/><\/a><\/p>\n<h3>About The Twitter Terms Of Service<\/h3>\n<p>Because this is a custom widget, you control what and how elements are displayed. Make sure to read Twitter\u2019s \u201c<a href=\"https:\/\/dev.twitter.com\/terms\/display-requirements\">Developer Display Requirements<\/a>\u201d to find out what you need to display. I will be breaking some of the rules for simplicity\u2019s sake, but bolting on stuff will be a trivial matter once you\u2019ve finished this article.Wordpress Themes<\/p>\n<p>Note that <strong>conforming to the requirements is a must<\/strong>. If you do not, you run the risk of your ID being banned which means that your widget will not display any tweets.<\/p>\n<h3>First Step: Create A Twitter App<\/h3>\n<p>Before writing any code, we\u2019ll have to get our hands on a Twitter app or, more appropriately, Twitter API credentials. The process is explained in a video that I made:<\/p>\n<p><iframe loading=\"lazy\" src=\"http:\/\/player.vimeo.com\/video\/60891535?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff\" width=\"500\" height=\"375\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>In case you prefer reading to watching a video, <strong>here are the basic steps<\/strong>:<\/p>\n<ol>\n<li>Log into Twitter\u2019s <a href=\"https:\/\/dev.twitter.com\/\">developers section<\/a>.<\/li>\n<li>Go to \u201c<a href=\"https:\/\/dev.twitter.com\/apps\">My Applications<\/a>,\u201d and click \u201cCreate a new application.\u201d<\/li>\n<li>Fill out the required fields, accept the rules of the road, and then click on the \u201cCreate your Twitter application\u201d button. You will not need a callback URL for this app, so feel free to leave it blank.<\/li>\n<li>Once the app has been created, click the \u201cCreate my access token\u201d button.<\/li>\n<li>You\u2019re done! You will need the following data later on:\n<ul>\n<li>consumer key,<\/li>\n<li>consumer secret,<\/li>\n<li>access token,<\/li>\n<li>access token secret.<\/li>\n<li><\/li>\n<li>\n<h2>WordPress Themes<\/h2>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Add Our App\u2019s Details<\/h3>\n<p>To add some options to our theme quickly, we\u2019ll be using the theme customizer, introduced in WordPress 3.4. Smashing Magazine has an <a href=\"http:\/\/www.smashingmagazine.com\/2013\/03\/05\/the-wordpress-theme-customizer-a-developers-guide\/\">exhaustive article on it<\/a>, if you\u2019re interested to learn more. For now, we\u2019ll just add the bare necessities.<\/p>\n<p>&nbsp;<\/p>\n<p>Adding the code above to your theme\u2019s <code>functions.php<\/code> file will generate a link to the customizer in the \u201cAppearance\u201d section of the admin area. To add some options, we\u2019ll need to create a class. Add a file named <code>MyCustomizer.class.php.<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>from : http:\/\/www.smashingmagazine.com\/2013\/06\/27\/create-twitter-widget\/<\/p>\n<blockquote class=\"mom_quote \" style=\"font-family:verdana;font-size:14px;font-style:italic;border-left-color:#dd9933; color:#474747; background-color:#F5F5F5; \"><span class=\"quote-arrow\" style=\"border-left-color:#dd9933;\"><\/span>This Demo Content Brought to you by <a href=\"http:\/\/momizat.com\/\" target=\"_blank\" rel=\"dofollow noopener\">Momizat Team<\/a> <\/blockquote>\n<h2>this is tags and keywords : wordpress themes momizat Tutorial wordpress  templates<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>How To Create A Twitter Widget for your WordPress Themes . Twitter needs no introduction.Wordpress Themes It has become the way to reach audiences for some people and companies and a place to hang out for others. Placing a Twitter feed on one\u2019s website has almost become compulsory. Embedding a feed isn\u2019t all that difficult [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3967,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"video","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[75,78,79,80,83],"_links":{"self":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/posts\/4457"}],"collection":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4457"}],"version-history":[{"count":0,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/posts\/4457\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/media\/3967"}],"wp:attachment":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}