Support » Plugin: Rotating Tweets (Twitter widget and shortcode) » Edit display formats

  • Resolved CharlieTait


    Firstly – great plug-in, thanks Martin!

    Now here’s the thing – I’m working to fit the plug-in with a particular visual identity and none of the display formats quite tick all the boxes. In a perfect world I’d like to use the original rotating tweets display format for the way it handles the author and tweet information but the Official Twitter Guidelines (regular) for the way it handles the time, date, source, retweet, reply and favourite information.

    Any suggestions on how I may achieve this would be appreciated.

    I’m nowhere-near-accomplished at CSS, next-one-up-from-novice at HTML and a novice and a newbie to php.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Martin Tod


    This is (currently) a fairly straightforward bit of PHP. If you open up rotatingtweets.php in something like Notepad++, all the action happens in lines 914-969. You’d need to add a new case 3 or 4 and lay out the text in the format you’d like.

    It would probably be something like:

    case 4:
    	$result .= "\n\t\t<p class='rtw_main'>$main_text</p>";
    	$result .= "\n\t<div class='rtw_meta'><div class='rtw_intents'>".rotatingtweets_intents($twitter_object,$twitterlocale, 1,$targetvalue).'</div>';
    	$result .= rotatingtweets_timestamp_link($twitter_object,'long',$targetvalue);
    	$result .= "\n</div>";

    after line 976 – and then using shortcodes

    [rotatingtweets screen_name='yourname' official_format='4']

    to get the result – but I haven’t tested this and don’t know if it will work!

    Thank you for your reply. It’s not working for me, I think I need to learn php to a better standard.

    I’m currently using the widget to control the display and as I start to understand php I think that maybe this solution can only be used with short codes and not with the widget. I assume I have to write more php inorder to access this display using the widget.

    I will try to control rotating tweets using shortcodes now and see if this works.


    This works with the smartcode and I’ve learnt a bit more in the process – thanks! Although I don’t seem to be able to get a result with the shortcode

    show_meta_screen_name = ‘1’

    The complete code is below

    <div id=”twitterfeed”><?php echo do_shortcode(“[rotatingtweets screen_name=’tees_er’ include_rts = ‘1’ tweet_count =’6′ show_follow = ‘1’ no_show_count = ‘1’ show_meta_timestamp = ‘1’ show_meta_screen_name = ‘1’ links_in_new_window = ‘0’ official_format=’4′ rotation_type =’scrollRight’ ]”); ?>

    </div><!– #twitterfeed –>

    I can’t see anything out of place, appreciate any ideas?

    …this is the site btw 🙂

    Plugin Author Martin Tod


    Looks good! Try the latest development version and let me know if it works for you!

    The flags only work with the original format currently – since the other formats (until now) have just replicated Twitter and so have no flexibility.

    Best wishes,


    Plugin Author Martin Tod


    If you’ve had any problems with the version I uploaded about 5 hours ago, the latest version should fix it.

    This version works OK – thanks. I’m a bit tied up currently but will be working on the site again soon.

    Hi Martin

    Those changes worked as I had hoped. However, I have realised that this format has the unfortunate effect of making some retweets look like they have originated on our Twitter account. I’ve been trying to substitute the ‘from Teeser’s Twitter’ for the original author’s name. I’m trying to workout what code I need to write. I’ve identified that it’s probably this section I need to change:

    $result .= sprintf(__(‘from %2$s\’s Twitter‘,’rotatingtweets’),’’.$user[‘id’],$user[‘name’]).’ · ‘;

    But I’m struggling to understand what I need to do – All my changes result in a blank browser screen! I’m trying to work it out using

    $result .= ‘— ‘.$user[‘name’].’ (@’.$user[‘screen_name’].’)

    Plugin Author Martin Tod


    It’s actually around line 901 that you need to change.

    I’ve updated the development version and it should now solve the problem – by using the historical approach of showing ‘RT’.


    Ah, thanks for the tip on where to look. I’ve tried to put together a new display format (code below) but I’m having difficulty working out 2 issues. Firstly I want to display the icon and author name in the same way as the regular twitter format – that is show the icon and name of the author, however I am getting results that always show the icon as the @tees-er twitter icon and name.

    The retweet, favourite and reply icons are also hidden until mouse rollover. I’ve been trying to make these always visible.

    Case 6;
    $result .= “\n\t\t<div class=’rtw_wide’>”;
    $result .= “\n\t\t<div class=’rtw_wide_icon’>”.rotatingtweets_user_intent($tweetuser,$twitterlocale,’icon’,$targetvalue).”</div>”;
    $result .= “\n\t\t<div class=’rtw_wide_block’><div class=’rtw_info’>”;
    $result .= “\n\t\t\t<div class=’rtw_name’>”.rotatingtweets_user_intent($tweetuser,$twitterlocale,’name’,$targetvalue).”</div>”;
    $result .= “\n\t\t\t<div class=’rtw_id’>”.rotatingtweets_user_intent($tweetuser,$twitterlocale,’screen_name’,$targetvalue).”</div>”;
    $result .= “\n\t\t<p class=’rtw_main’>”.$main_text.”</p>”;

    $result .= “\n\t\t<div class=’rtw_meta’><div class=’rtw_intents’>”.rotatingtweets_intents($twitter_object,$twitterlocale, 1,$targetvalue).'</div>’;
    $result .= rotatingtweets_timestamp_link($twitter_object,’long’,$targetvalue);
    if(isset($retweeter)) {
    $result .= ” · “.rotatingtweets_user_intent($retweeter,$twitterlocale,sprintf(__(‘Retweeted by %s’,’rotatingtweets’),$retweeter[‘name’]),$targetvalue);
    $result .= “</div></div></div></div>”;

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Edit display formats’ is closed to new replies.