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:
5. That’s it. Now update the page and you should see the Tweet centered on the frontend of your website.
Disclosure: This page may contain affiliate links. If you follow one of those affiliate links and purchase something it will provide me with a little bit of a commission. This costs you nothing extra but helps maintain my site, free plugins, and themes. So I thank you for your support.