Failing to embed twitter timeline
-
Hello I’m currently trying to embed a Twitter feed to my homepage.
On twitter you can copy the html code and then insert it into the HTML block in WordPress.
When I hit preview the timeline shows up but on the live page I just get this text:
“Tweets by (user) https://platform.twitter.com/widgets.js”
Am I doing something wrong?The blog I need help with is: (visible only to logged in users)
-
Hi there,
You need not copy the HTML code to embed the Twitter feed to your site.
Instead, you can add the Twitter Timeline widget.
If you want to display the feed only on the Homepage, you can set the widget visibility to display the widget only on the Homepage as explained here:
https://wordpress.com/support/widgets/#widget-visibility
Thanks!
-
Thank you for your response. I already was aware of the Timeline widget. Since I’m using the TwentyTwenty theme I seem to only be able to use it in the footer of my page. I’m now using the Twitter block in the page editor. I wanted to use the HTML code because it gave me more options in styling it.
-
Hi there,
Twitter’s embed code using JavaScript code, and that type of code cannot be used on WordPress.com except on our Business Plan. If you try to use JavaScript code inside a HTML block, the code will simply get stripped out as soon as you save/update the post.
You can learn more about the code restrictions on WordPress.com here:
https://wordpress.com/support/code/
The only option we support for embedding Twitter content is via oEmbed, i.e. where you copy the direct link to the tweet, and paste that directly into a new line in the editor/the Twitter embed block.
https://wordpress.com/support/wordpress-editor/blocks/twitter-block/
The block allows you to embed both single tweets and Twitter threads.
- The topic ‘Failing to embed twitter timeline’ is closed to new replies.