Twitter is a popular social media where we can share content and interact with users. If you are running a website on WordPress like me, you should know how important social sharing is to the success of a business. Twitter allows you to embed Tweets into your site, so you can share what’s happening on Twitter with your visitors. But how do you align it? In this article, I will show you how to center a Tweet in WordPress.
How to Center a Tweet in WordPress
1. Go to Twitter, select the Tweet that you wish to embed and click Embed Tweet.
For WordPress, you could easily copy the link to the Tweet and insert into a page to embed it. But that way you won’t be able to center it. So we are going to use the full embed code.
2. Copy the embed code.
3. Create a new WordPress page or edit one and paste the embed code into the text editor.
4. By default, you will notice a class attribute in the embed code: class=”twitter-tweet”. Just edit the class attribute and add this class to it: tw-align-center. So your final class attribute should look like the following:
class="twitter-tweet tw-align-center"
5. That’s it. Now update the page and you should see the Tweet centered on the frontend of your website.
itunes gratis says
Un buen articulo.
Jack Flowers says
Thank you, any way to embed a tweet in wrapped format?
golden seo says
nice and superb
Jason says
Thank you very much for your help, it worked!
Just replaced
class=”twitter-tweet”
to
class=”twitter-tweet tw-align-center”
and it worked like a charm!
Thank you for sharing the tip!