MyBB Community Forums

Full Version: Embed Twitter Tweet MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have been using this on my board since 2018; however, after upgrading to MyBB 1.8.27, I discovered that the Thread Views count was not incrementing on viewing threads containing embedded tweets.

After a bit of investigation, I managed to fix this, by doing the following:

1. Adding </p> tag, to close the <p> tag;
2. Changing the 'async' attribute of the <script> tag to async="".

Thus, the new code (that works for me with MyBB 1.8.27) is as follows: 

<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"></p><a href="$1"></a></blockquote>
<script async="" src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

I hope this helps anybody who has run into the same problem as me Smile !
Thank you. That last code solved the problem on my site where I'm running 1.8.35
After I switched to 1.8.29 my Twitter code cannot be centered. It's always shows aligned to left. Any solutions for that?

It's my code:

<blockquote class="twitter-tweet"><a href="$1%"></a></blockquote> <script async="true" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Pages: 1 2