Embedding a Twitter timeline

  • Unknown's avatar

    Are there any known workarounds for embedding a Twitter timeline using the HTML/JS code generated from publish.twitter?

    When using the Text widget, the system automatically removes data tags (i.e. data-width or data-theme), effectively precluding customizations. To make matters worse, the timeline will not display unless I have the core Twitter widget displayed somewhere on the page (although it doesn’t need to be configured).

    This is probably the goofiest support for Twitter that I’ve ever seen with a CMS.

    Lastly, to be clear, I’m obviously aware of the default Twitter Timeline widget but it’s monstrous and unsightly.

    The blog I need help with is: (visible only to logged in users)

  • Hi orbitstorm.

    I just tested the publish.twitter.com embed code for your timeline on a non-WordPress.com website to see how it looks, and for me it looks the same as the Twitter Timeline widget here in WordPress.com?

    Have a look at these two screenshots:

    This one is the embed code from publish.twitter.com:
    https://prnt.sc/ifbzi2

    And this one the default Twitter Timeline widget on a WordPress.com site:
    prntscr.com/ifbzz6

    I’m not sure by what you mean by,

    Lastly, to be clear, I’m obviously aware of the default Twitter Timeline widget but it’s monstrous and unsightly.

    Just want to double check that I understood you right.

  • Sorry – second screenshot link is broken. Here is it again

    https://prnt.sc/ifbzz6

  • Unknown's avatar

    You’re everywhere today!

    Here’s the code I’m trying to use:

    <a class="twitter-timeline" data-width="300" data-height="500" data-theme="dark" href="https://twitter.com/iOrbitStorm?ref_src=twsrc%5Etfw">Tweets by iOrbitStorm</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

    All data tags are automatically removed when I save the widget. Not sure why. There are a number of customizations that I’d be able to use with the publish.twitter embed.

    The default timeline widget available via the widgets page doesn’t allow the height to be resized nor does the scrollbar appear. There’s a lot of similarities between the core widget and the publish.twitter widget but it seems neither are working properly.

    Currently, I have just the core widget enabled. Everything but height and scrollbar works.

  • Ok, I pasted your code to the non-WordPress.com site and this is how it looks –

    https://prnt.sc/ifcdvj

    I still see the scroll bar even if I use the embed code.

    When I take your settings from the embed code and enter them into the widget settings (the height, width and the dark theme) I get the same results as I got when using the code:

    https://prnt.sc/ifcd45

  • There is also more layout options in the widget setting that you can use – one of them is to remove the scroll bar etc.

  • Unknown's avatar

    Odd. Wonder if it’s a theme-related issue?

    When entering a value into the height field for the default Twitter Timeline widget, that number is removed the moment I press “save”. It never takes effect. I’ve tried logging out/in, clearing browser cache, redoing the widget, etc. Still the same results.

    Text widget doesn’t seem to fully support HTML/JS so that doesn’t appear to be an option.

  • Dis you enter a number of tweets to show? As soon as I enter a number in there the height gets removed.

  • The text widget falls under the same security restrictions as pages and posts regarding code – you can read more about what is allowed here:

    https://en.support.wordpress.com/code/

  • Hi there,

    The default timeline widget available via the widgets page doesn’t allow the height to be resized nor does the scrollbar appear.

    Are you speaking of this widget?

    Twitter Timeline Widget

    That widget both allows you to set the height and it shows a scrollbar which can be disabled.

    You cannot use Twitter’s own embed code in a text widget or a post or page’s content, as we don’t allow iframe or JavaScript code on WordPress.com for security reasons. To use that type of code on WordPress.com you’ll need to upgrade to the Business Plan.

  • The topic ‘Embedding a Twitter timeline’ is closed to new replies.