• Resolved Sander

    (@zanderz)


    Hi,

    currently, the avatar of a Twitter is hardcoded at 48px (CtfFeed.php, lines 1194 and 1346)
    However, we would like to show it a bit larger and in higher resolution (i.e. load 120px version and display it at 60px)
    Would it be possible to add this, or does Twitter only supply a 48px version?

    Thanks for this plugin btw, it’s very easy to use and configure!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Sander

    (@zanderz)

    FWIW, I hacked it together using this for now:

    
    function tweetHack()
    {
        $content = do_shortcode('[custom-twitter-feeds]');
    
        $content = str_replace(
            'Twitter_normal.jpg',
            'Twitter_200x200.jpg',
            $content
        );
        $content = str_replace(
            'width="48" height="48"',
            'width="75" height="75"',
            $content
        );
        echo $content;
    }
    add_shortcode('tweethack', 'tweetHack');
    
    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey Spinal,

    Glad you like the plugin! Also it definitely looks like your hack will work. If you didn’t want to do a string replace on the entire feed in php you could use the following JavaScript to do this instead:

    jQuery('.ctf-header-img img').attr('src',jQuery('.ctf-header-img img').attr('src').replace('_normal.jpg','_200x200.jpg')).attr('height','75').attr('width','75');
    
    jQuery('.ctf-item').each(function() {
      jQuery(this).find('.ctf-author-avatar img').attr('src',jQuery(this).find('.ctf-author-avatar img').attr('src').replace('_normal.jpg','_200x200.jpg')).attr('height','75').attr('width','75');
    });

    You would want to add this to the “Custom JavaScript” area on the Customize tab. The top part changes the avatar in the header and the bottom part will change all of the author avatars next to the tweets.

    Hopefully that helps!

    Thanks,

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey Spinal,

    This topic has been quiet for awhile. I’ll go ahead and mark it resolved but let me know if you need anything else!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Feature request: higher resolution avatars’ is closed to new replies.