simpladesign_ru Posted June 9, 2012 Report Share Posted June 9, 2012 Данное решение выводит список последних твиттов из вашего твиттера.Подключаем скрипт в шаблоне <strong>index.tpl</strong> {* Последнии твитты*} <script src="design/{$settings->theme}/js/mylatesttweets.js"></script> Сам фаил скрипта скачиваем тут: <a href='http://simpladesign.ru/wp-content/uploads/2012/06/mylatesttweets.js'>mylatesttweets.js</a>так же в фаил <strong>index.tpl</strong> добавляем: <script type="text/javascript"> var twitter; YAHOO.util.Event.onDOMReady( function() { window.twitter_callback_search = function (twitter_object) { twitter.CallBack(twitter_object); }; if (twitter == undefined) { twitter = new MyLatestTweets('twitter'); } //Settings: ########################### twitter.SearchTag = 'from:simpladesign'; //Измените "simpladesign" на логин вашего твиттера twitter.MaxResultsNumber = 6;//Максимальное колличество твиттов // если вы хотите установить язык, просто удалите "//" в следующей строке: // twitter.Language = 'en'; //Settings End. ########################### twitter.TwitterCall(undefined, '', 'twitter_callback_search'); }); </script> Не забываем отредактировать ваш логин в твиттере и количество выводимых твиттовВ файле вашего шаблона, где необходимо вывести блок с твиттами вставляем: <!-- Последние твитты --> <div id="mylasttweets" class="mylasttweets"> <ul id="twitter_content"><div id="twitter_entries"><li>Загрузка...</li></div></ul> </div> <!-- Последние твитты (The End) --> В фаил <strong>style.css</strong> вашей темы добавляем:* { margin: 0; padding: 0;}.mylasttweets { width: 250px; float: left;}.mylasttweets ul { border: 1px solid #e5e5e5; background: #fff; margin: 0; padding-top: 1px; list-style: none;}.mylasttweets li { font-family: Arial, Helvetica, sans-serif; clear: both; text-align: left; font-size: 11px; line-height: 14px; padding: 10px; border-bottom: 1px solid #e5e5e5; background: #FFF;}#twitter_content { font-family: Arial, Helvetica, sans-serif; font-size: 11px;}li:after { content: "."; display: block; height: 0; clear: both; visibility: hidden;}li { *zoom: 1 }.mylasttweets li:hover { background: #f7f6f0; cursor: pointer;}.mylasttweets a { text-decoration: none; cursor: pointer;}.mylasttweets a:hover { text-decoration: underline }.mylasttweets cite { font-weight: bold; font-style: normal; color: #000;}.mylasttweets cite a { color: #000 }.mylasttweets span { color: #000 }.mylasttweets span a { color: #0095EB; font-weight: bold;}.mylasttweets input { background: transparent url('http://twitter.com/favicon.ico') 0 50% no-repeat; text-indent: 18px; width: 100%; border: 1px solid #ccc;}.mylasttweets p { display: block; color: #0095EB;}.mylasttweets p a { color: #0095EB }.mylasttweets p:after { clear: both; display: block; height: 0; visibility: hidden;}.mylasttweets img { margin: 0 10px 10px 0; height: 36px; width: 36px; border: 3px solid #e5e5e5;}.mylasttweets img:hover { border: 3px solid #0095EB }.mylasttweets .hidden { display: none }.mylasttweets p:after { clear: both; display: block; height: 0; visibility: hidden;}Источник Quote Link to post Share on other sites
dpdp Posted June 23, 2015 Report Share Posted June 23, 2015 Было бы круто обновить это решение. А то "готовое решение" совсем не готово. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.