How to Add Social Media Icons in Your WordPress Sidebar

Are you wondering how to add social media icons to your WordPress sidebar?

Adding social icons to your website is an easy way to let your audience know about your social media presence. That way, they can easily visit your social profiles and follow you online.

In this article, we will show you how to add social media icons to your WordPress sidebar.

How to Add Social Media Icons in Your WordPress Sidebar

Why Add Social Media Icons to Your WordPress Sidebar?

A WordPress sidebar is an area on your website that is not a part of your main content. It’s where you can display additional information that readers may be interested in, such as your most recent blog posts and links to your social profiles.

Adding social links to your WordPress sidebar is a good idea because it tells users about your social media accounts. As a result, they can check them out, follow you, and help you grow your social media following.

What’s more, displaying your social media accounts can build a sense of credibility and serve as social proof. When visitors see that you have an active social media presence, this shows that your business is responsive and trustworthy.

Many popular WordPress blogs display social media icons in their sidebars, like WPBeginner:

WPBeginner's social media icons on the sidebar

Note: Social media icons are different from social share buttons on WordPress posts. If you are looking to add share buttons, then you can see our beginner’s guide on how to add social sharing icons in WordPress.

With that being said, let’s take a look at how to add social media follow icons to your WordPress sidebar. The method you should use depends on the WordPress theme and editor you are using. If you want to skip to a certain section, then you can use these quick links:

Method 1: Adding Social Icons With Full Site Editor (Block Themes)

If you are a block theme user, then you can add social media buttons to your WordPress sidebar using the Social Icons block.

Note that the process varies by the theme you use. Some block themes may include a sidebar by default, which you can then add the Social Icons block to. Some might also have a header pattern that functions like a sidebar, and some may not have a sidebar at all.

In this example, we will use a default WordPress block theme and show you how to create a sidebar for all your pages or posts where you can add the Social Icons block.

First, go to Appearance » Editor in your WordPress admin panel.

Selecting the Full-Site Editor from the WordPress admin panel

Next, you need to select ‘Templates.’

This will bring you to a page where you can edit the template of your pages and posts.

Choosing the Templates menu on WordPress Editor

Here, you can choose one of the page templates. It may be either ‘Pages’ or ‘Single Posts,’ depending on where you want the sidebar to be.

If you want the sidebar to show on both your static pages and posts, then you can edit both of them later. You can also customize the homepage template in case you need the sidebar to appear there, too.

In this case, we will select ‘Pages.’

Selecting Pages on the WordPress Editor Templates page

After that, click the pencil button in the left panel next to the three-dot button.

This will open up the WordPress editor.

Clicking the pencil edit button on Pages inside the WordPress editor

As you can see, the default theme doesn’t have a sidebar in the Pages template yet, so we need to create one for it.

To do this, you can hover over where you want to add the sidebar and click the add block ‘+’ button when it appears. Then, find and select ‘Columns.’

Selecting the Columns block on WordPress editor

There will be some variations to choose from.

In this example, we will use the ‘66 / 33’ option to imitate the standard look of a right sidebar.

Choosing one of the variations of the Columns block in WordPress editor

Once done, you can drag and drop the Post Content block to the left of the Columns block.

Your Pages template should look something like the image below, with the right column empty.

Moving the Post Content block to the left side of the Columns block

Now, click on the right column and select the add block ‘+’ button.

Then, search for the Social Icons block.

Searching for the Social Icons block to add to the Columns block

You can now start adding your social media platforms to the block. Simply click the ‘+’ button again and add your social media buttons one by one.

Feel free to use the search feature to browse all of the social network options.

Adding a social profile to the Social Icons block

Once you’ve added all of the buttons, you can start adding links to your social profiles.

All you need to do is click on a social icon and enter your profile URL.

Entering an Instagram account link to the Social Icons block

At this stage, you can customize how the icons look.

If the size of the buttons isn’t big or small enough, then you can use the ‘Size’ option in the block toolbar.

Customizing the buttons' sizes using the Social Icons block toolbar

In the Block Settings on the left, you can customize the icons’ justification, orientation, link settings, and labels.

We recommend making the links open in a new tab so that users won’t need to leave your website to visit your social profiles.

Social Icons Block Settings

If you switch to the Block Styles tab, then you can change the icons’ styles and colors to suit your WordPress website design.

Depending on your preference, you can make all the icons have different colors or the same one, like below.

Configuring the Social Icons color and styles in the Block Styles tab

Scrolling down the same tab, you’ll find the Dimensions settings to customize the block margin and spacing.

These settings can be helpful if you want to adjust the spacing between the Social Icons block and other blocks in the sidebar.

Configuring the Dimensions settings of the Social Icons block

It’s also a good idea to add a call-to-action text on top of the Social Icons block to highlight where the buttons are and draw website visitors’ attention.

To do this, go ahead and add a Paragraph block using the ‘+’ button. Make sure it’s above the social icons.

Adding a Paragraph block on top of the Social Icons block

Some call-to-action examples you might use are ‘Follow Us, ‘Join Over X Readers,’ or ‘Get the Latest Updates.’

If you haven’t already, then you can also add more elements to the sidebar, like your featured posts and recent comments.

Now, simply click the ‘Save’ button in the top right corner of the page.

Clicking the Save button on the WordPress editor

And that’s it!

When you go to your WordPress website, you should now see a sidebar with some social links.

Example of what the Social Icons block looks like on the front end

If you want to create unique sidebars for different pages or posts, all of which include a Social Icons block, then we recommend creating a WordPress pattern or reusable block for your sidebar.

To learn more, you can check out our beginner’s guides on how to use WordPress block patterns and how to add reusable blocks.

Method 2: Adding Social Media Icons With WordPress Widgets (Classic Themes)

This next method is for people using a classic WordPress theme with widget-ready sidebar areas.

To add social media buttons to your sidebar, simply head to Appearance » Widgets from your WordPress dashboard.

Then, navigate to the WordPress widget area where you want to add the Social Icons widget. In our example, we will select ‘Sidebar,’ but the name may be different depending on the theme you are using.

Navigating to the Appearance Widgets menu and selecting Sidebar on WordPress admin panel

Now, click the add block ‘+’ button at the top left, next to ‘Widgets.’

Here, you can look for the Social Icons block.

Choosing the Social Icons block in the WordPress Widgets settings

After that, you need to click on this sidebar widget or drag and drop it anywhere in the editing area.

In general, it’s best to add your social network icons close to the top of the widget area. This way, they can catch your visitors’ attention right from the moment they land on the page.

Then, similar to the previous method, you can click the ‘+’ button to add new social media buttons one by one to the widget.

In the example below, we have placed the Social Icons block below the Search block. We are also adding a WhatsApp icon.

Placing the Social Icons widget below the Search widget and adding the WhatsApp icon

At this point, you can start adding your social links.

For WhatsApp, you can type ‘wa.me/’ and write your WhatsApp number next to it. There is no need to use the + symbol, but make sure to add your country calling code, like in this screenshot.

Adding a WhatsApp number in the Social Icons block

You also have access to the Block Settings and Styles options in the right panel.

To open these options, you can click the ‘Settings’ icon in the top right corner.

Selecting the Settings icon on the Widgets page

Additionally, feel free to add a Paragraph block on top of the social media widget for your call-to-action text.

We recommend making the Paragraph and Social Icons blocks a Group so that they don’t look separated in the sidebar.

To do this, just select the Paragraph and Social Icons together. After that, click the ‘Transform’ icon in the block toolbar and select ‘Group.’

Grouping the Social Icons and Paragraph blocks

Once finished, go ahead and click the ‘Update’ button to make the changes official on all of your sidebars.

Here’s what the end result should look like:

An example of what the Social Icons widget looks like on the website

Method 3: Adding Custom Social Media Icons With SeedProd (Custom Themes)

If you use SeedProd, then you will have more control over how your social media buttons look in your sidebar. For example, if you use a social media platform that WordPress doesn’t have an icon for, then you can create a button for it yourself.

Additionally, you can adjust the icon spacing specifically for mobile devices.

If you are new to SeedProd and want to use it, then you need to install and activate the plugin first. You will need the Pro version to be able to access the Social Profiles feature.

For more information on how to install a plugin, check out our guide on how to install a WordPress plugin.

Then, you can follow this tutorial to set up your theme with SeedProd.

Now, to add the social icons to the sidebar, you will need to go to SeedProd » Theme Builder. Then, hover over the ‘Sidebar’ template and click ‘Edit Design.’

Clicking Edit Design on the Sidebar template inside SeedProd

You are now inside the SeedProd page builder. The Social Profiles block should have been added by default to the theme template.

If it hasn’t, however, you can use the search bar in the left panel and type in ‘Social Profiles.’ After that, simply drag and drop the block to wherever is suitable for you.

Selecting the Social Profiles block on SeedProd

Don’t forget to add a Text block on top of the buttons and write some call-to-action text.

This way, you are directing visitors’ attention to the social media buttons in the sidebar.

Creating a Follow Us text on top of the Social Profiles block on SeedProd

To customize how the social media profile icons look, just click on the ‘Social Profiles’ element. Here, you will see different tabs to customize the buttons.

In the ‘Content’ tab, you can add more icons and change the icon style, icon size, and alignment.

Configuring the Content tab of the Social Profiles block in SeedProd

Besides the standard options like Instagram and Facebook, SeedProd also has buttons for Slack, Telegram, Github, and more.

To add a new social media icon that SeedProd doesn’t have by default, you need to click the ‘+ Add New Share’ button.

After that, select ‘Custom’ from the dropdown menu.

Creating a Custom social media button on SeedProd

To edit the button, go ahead and click the gear settings symbol next to the arrow button.

Once you’ve done that, just select ‘Choose Icon.’

Clicking the Choose Icon for the custom social media button on SeedProd

Now, you will be redirected to the Icon Library, where there are hundreds of brand icons to choose from, courtesy of Font Awesome icons.

In this example, we will use Airbnb.

Choosing the Airbnb icon on SeedProd

Once you have selected an icon, you can adjust the color and add the link to the social media page.

Here, we’ve decided to stick with Airbnb’s brand color. When inserting the social account link, make sure to include the ‘https://’ as well.

Configuring the Airbnb icon design on Social Profiles block inside SeedProd

Next is the ‘Templates’ tab.

If you switch to this tab, you can adjust the design of the icon. You can make it more square, circular, and/or monochromatic, depending on your preferences.

Editing the Templates setting for the Social Profiles block in SeedProd

Lastly, the ‘Advanced’ tab offers more ways to customize your social media buttons.

The Styles section is where you can change the icons’ style, color, size, space in between, and shadow effect.

The Styles tab in the Social Profiles block settings in SeedProd

In Spacing, you can edit the block’s margin and padding. What’s great about SeedProd is it allows you to make the margin and padding different for desktop and mobile devices.

To edit the margin and padding, just choose one of the device icons and insert your margin and padding measurements like so:

Configuring the Social Profiles block spacing in SeedProd

Scrolling down, you will find Device Visibility and Animation Effects.

In the first setting, you can opt to hide the block on desktop or mobile. This may be necessary if you have chosen to use the Social Profiles block in another part of your website and don’t want duplicate social profile icons.

With Animation Effects, you can select an animation style for the block when the icons are loaded on the web page. This effect is not necessary if you don’t want to distract the visitor too much from the main content.

SeedProd's Device Visibility and Animation Effect settings for the Social Profiles block

Once you have configured the Social Profiles block to your liking, simply click the ‘Save’ button in the top right corner.

Or, click the ‘Preview’ button to see how the sidebar looks first.

Clicking the Save button on SeedProd

And that’s it! You have successfully added the social profiles block using SeedProd.

Here’s what the end result may look like:

Example of what the social media icons in the sidebar look like if made with SeedProd

We hope this step-by-step guide has helped you learn how to add social media icons to your WordPress sidebar. You may also want to check out how to display different sidebars for each post and page in WordPress and our list of the must-have WordPress plugins for business sites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add Social Media Icons in Your WordPress Sidebar first appeared on WPBeginner.

How to Promote Your Twitter Page in WordPress with a Popup

Do you want to show promote your Twitter page using a popup on your WordPress site?

Showing your Twitter page as a popup is a great way to get more followers and boost engagement. You can use your existing website traffic to grow to promote social content on your Twitter account.

In this article, we will show you how to promote your Twitter page in WordPress with a lightbox popup.

How to promote Twitter page with lightbox popup

Why Promote Your Twitter Page in WordPress?

Twitter is one of the most popular social media platforms. Many businesses use it to promote their products, blog posts, share announcements, and news. Plus, it’s a great place to get feedback from users, run a poll, and hold audio webinars through Twitter Spaces.

However, getting more people to follow you on Twitter can be hard work. What if you could use your existing website traffic to grow your social media followers using a lightbox popup?

You can display your Twitter page in a lightbox popup anywhere on your website. This will help improve the visibility of your Twitter profile and increase followers.

That’s not all, you can also use a lightbox popup for building an email list, generating leads, offering content upgrades, displaying a contact form, and more.

Let’s see how you can use a lightbox popup to promote your Twitter page.

Promoting Your Twitter Page in WordPress with a Lightbox Popup

The best way to add a lightbox popup in WordPress is by using OptinMonster. It’s the best WordPress popup plugin and lead generation software in the market.

OptinMonster makes it super easy to boost sales, generate leads, grow your email list, and optimize your site for more conversions.

First, you’ll need to visit the OptinMonster website and click the ‘Get OptinMonster Now’ button to create an account.

Click get OptinMonster now

For this tutorial, we’ll use the OptinMonster Pro license because it includes the Exit Intent feature, more customization options, and pre-built templates. You can get an additional 10% off using our OptinMonster coupon code.

After creating an account, you’ll need to install and activate the OptinMonster plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you’ll be taken to the OptinMonster setup wizard screen. Go ahead and click the ‘Connect Your Existing Account’ button.

Connect your existing account

A new popup window will open, confirming the OptinMonster account to use.

Simply click the ‘Connect to WordPress’ button to continue.

Click the connect to WordPress button

Next, you can go to OptinMonster » Campaigns from your WordPress dashboard to create a campaign.

Go ahead and click the ‘Create Your First Campaign’ button.

Create first OptinMonster campaign

After that, OptinMonster will offer you different campaign types to choose from.

Since we want to create a lightbox popup, simply select the ‘Popup’ campaign type.

Choose campaign type

Below the campaign type, you’ll see different templates for your popup campaign.

You can select a template by hovering over it and then clicking the ‘Use Template’ button. For this tutorial, we’ll use the ‘Social’ template.

Select a social template

Next, a popup window will open where you can enter a name for your campaign.

Once you’ve added a name, go ahead and click the ‘Start Building’ button.

Click start building

This will launch the OptinMonster campaign builder, where you can use the drag-and-drop builder to customize your popup.

The plugin offers different elements to add to the template from the menu on your left.

Campaign builder in OptinMonster

You can also edit existing blocks in the template.

For instance, you can remove other social networks, but keep the Twitter button to provide a call to action button that allows users to follow your Twitter page.

Plus, there are options to edit the text in the headings and body. For example, if you want the button to read ‘Follow me’ instead of ‘Twitter,’ you can change the ‘Button Text’ field to the left.

Next, you can click on the Twitter button to see more options in the menu on your left. Go ahead and enter your Twitter page link under the ‘New Window URL’ field.

Add your twitter link in the button settings

Next, simply drag the ‘HTML’ block from the menu and drop it on the template.

Now, you have a block ready for the HTML code you’ll get in the next step.

Add a HTML block to template

Creating a Twitter Page Embed Code

Next, you’ll need to create an embed code for your Twitter page by going to the Twitter Publish tool.

We recommend opening the tool in a new tab or window because you’ll need to switch back to the OptinMonster campaign builder to enter the HTML code.

Once you’ve opened the Publish tool, you can add your Twitter page URL in the ‘What would you like to embed’ field and hit the enter key on your keyboard.

Your Twitter URL will look like https://twitter.com/YourUserNameHere. Just replace ‘YourUserNameHere’ with your own Twitter handle.

Twitter publish tool

After that, you can scroll down and choose whether you’d like to embed the Twitter timeline or buttons.

We’ll choose the ‘Embedded Timeline’ option for this tutorial to show the tweets from our Twitter page in the popup lightbox.

Choose timeline or buttons to embed

Next, you can scroll down to open the customization settings.

Simply click the ‘set customization options’ link above the embed code.

Click set customization options

In the customization options, you can edit the height and width of the Twitter timeline. This allows you to control the appearance of your timeline in the lightbox popup.

There are more settings for choosing a light or dark theme for your timeline and the language in which the tweets will be displayed.

Customize the twitter timeline

Once you’ve configured these settings, click the ‘Update’ button.

After that, the Publish Tool will generate an embed code. You can click the ‘Copy Code’ button.

Copy the embed code

A popup window will now show that you’ve successfully copied the embed code.

Go ahead and click the cross icon in the top-right corner to close the popup window.

Successfully copied the code

Adding Twitter Page Lightbox Popup to Your Website

Now, you can go back to the OptinMonster campaign builder window or tab in your browser.

Next, click on the HTML block in the pop-up you are designing. You will see a field to the left where you can paste the embed code from the Twitter Publish tool.

As you enter the embed code, you’ll see a preview of your Twitter timeline in the campaign template.

Enter the embed code in the html block

After that, you can head to the ‘Display Rule’ tab. Here, you can set the conditions for when the lightbox popup will appear on your website.

For instance, it can appear when a user views a page for a specific period of time, visits a particular page, or is about to leave your website.

Select display rules

For this tutorial, we’ll select the ‘Time on Page’ as the display rule and set the number of seconds after which the popup will appear.

Next, you can make the popup appear on every page on your site by setting ‘current URL path’ to ‘is any page.’

Configure display rules

After that, you can switch to the ‘Actions’ tab at the bottom.

Now ensure that ‘Optin’ is selected for the ‘show the campaign view’ option. There are also optional settings to add effects and sound to your popup.

Set up display rules actions

Next, you can go to the ‘Published’ tab to activate your campaign.

Simply change the ‘Publish Status’ from Draft to Publish.

Publish your campaign

You can now click the ‘Save’ button at the top to store your settings and close the campaign builder.

To confirm if your campaign is published, head to OptinMonster » Campaigns in your WordPress admin panel. You should see green text that reads ‘Published’ under the ‘Status’ column.

If not, you can click the ‘Change Status’ option under your campaign name and select ‘Publish’ from the dropdown menu.

Change the campaign status to published

Your OptinMonster campaign will now be active.

To view your Twitter page in the lightbox popup, simply visit your website. After the OptinMonster campaign triggers, your Twitter profile will appear in a lightbox popup along with the CTA button you added beneath it.

Twitter page popup preview

We hope this article helped you learn how to promote your Twitter page in WordPress with a lightbox popup. You may also want to see our ultimate WordPress SEO guide for beginners and the best live chat software for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Promote Your Twitter Page in WordPress with a Popup first appeared on WPBeginner.

The WordPress Community Isn’t Ready to Leave Twitter

Elon Musk has bought Twitter in a $44B deal that closed this week, tweeting “Let the good times roll,” on Friday after taking the helm. Musk fired top executives at the company and tweeted an appeal to Twitter’s advertisers to share his motivation in acquiring what is arguably the world’s most important social network:

“The reason I acquired Twitter is because it is important to the future of civilization to have a common digital town square, where a wide range of beliefs can be debated in a healthy manner, without resorting to violence,” Musk said. “There is currently great danger that social media will splinter into far right wing and far left wing echo chambers that generate more hate and divide our society.”

Musk also hinted at the importance of content moderation, saying “Twitter obviously cannot become a free-for-all hellscape, where anything can be said with no consequences!” The company is forming a council to discuss content moderation, but nobody knows what that will mean for the future of Twitter.

While some Twitter users have considered migrating to Tumblr, the structure and user base isn’t currently comparable to the Twitter experience. In response to Verge co-founder Nilay Patel’s provocative article titled “Welcome to hell, Elon,” Tumblr CEO Matt Mullenweg tweeted his support.

“This is an unfortunately good summary of why running a social network is so hard, as I’ve learned with Tumblr,” Mullenweg said. “I am wishing Twitter the best and also hope this doesn’t slow down Tesla or SpaceX, which I think are critical to the future.”

Patel aptly communicated the weight of the political challenges Musk will face in his commitment to steering Twitter away from becoming “a free-for-all hellscape,” which some think has already happened. If Musk decides to open the doors to unsavory characters who were banned in the past, it may drive the social network into the ground.

While the WordPress community has many online gathering places – various Slack workspaces, P2 blogs, and Facebook groups – it has always been Twitter that served as the place for both casual interactions and breaking news. It is the de facto social network for those working in tech. There are many who only use the platform for keeping up with WordPress news and the community.

“There’s nowhere else to really go!” WordPress product designer Mike McAlister said. “WordPress people are pretty much exclusively on Twitter it seems.”

Apart from the few optimistic souls who think Twitter will be better than ever, many community members expressed apprehension about losing the network they have built over the years. As the closing of the sale loomed, people threatened to leave Twitter on principle if Musk gained control. That day has arrived, but for the most part the WordPress community is not abandoning Twitter.

“Twitter has had too good of an impact on my life to just jump ship,” Edan Ben-Atar said. “I’ll stick around for as long as it makes sense. For now, nothing has changed from what is noticeable to the eye.”

WordPress designer Dustin Henrich says he is staying but also looking up the people he follows on other platforms.

“I’ve made too many good connections, enjoy reading about people’s tech and non tech lives, and learning from some wicked smart people,” Henrich said. “I’d truly be sad if this just all went away.”

Decentralized social networking, which has so far failed to gain much mainstream attention, is getting a second look in light of Twitter changing hands. WordPress agency owner Tom Finley is experimenting with using the Activity Pub plugin to set up his site as a private Mastadon server. It implements the ActivityPub protocol for WordPress so readers can see the site’s posts on Mastadon and other federated platforms (that support Activity Pub).

Some WordPress community members are flirting with joining Mastadon instances, or have already committed to posting in both networks, but we are not yet seeing a mass exodus flocking to the fediverse.

“We’ve seen this attempted exodus to the promised land many times before,” Ross Wintle said in a post that explains why he isn’t optimistic about people successfully leaving Twitter. “Without a proper mass migration of people and organizations to another service, it doesn’t stick.

“You end up with people cross posting to multiple services to reach all the people that they want to reach. And then as a reader I’m checking multiple services and seeing the same things. The signal/noise ratio goes down. And most people get fed up and end up back where they were before.”

The most hopeful speculators ask if this could this be the return of blogs. At the moment blogs are not social enough, and there isn’t a critical mass of bloggers eager enough to adopt the protocols necessary to connect their sites in a stream of easily digestible, short updates.

Until Elon Musk makes more radical changes, many WordPress community members see no reason to leave Twitter.

“For now, I don’t see a reason to leave,” WordPress developer advocate Birgit Pauli-Haack said. “Block, Unfollow, Mute are my friends for curating my feed. I did cancel my subscription to Twitter Blue after 12 months. Being allowed to edit tweets is not worth it.”

Overall, most people are taking a “wait and see” approach regarding leaving Twitter.

“I haven’t found a viable alternative,” WordPress meetup organizer Sallie Goetsch said. “I do hang out in various WP Slack groups, but for the wider world…we’ll just have to see what happens here.”

One positive byproduct of this recent shake-up is that the WordPress community is considering a future where important conversations happen on another platform. As users explore other social networks, they may gain an affinity for a different type of social media culture with features that Twitter is lacking. Migrating and settling into a new social home on the web takes time.

“I’m not saying I wouldn’t love a mass migration to happen,” Ross Wintle said. “I’ve just seen so many attempts now and none seem to have been particularly successful, and I don’t see why this one would either.

“For a big change to happen, I think either the platform has to spontaneously combust itself or it falls out of fashion by a long period of attrition and fades from the public consciousness over time. Facebook may even be at the start of this. Time will tell.

“Perhaps, one day, we will look back and remember that thing we all used called Twitter the same way we remember Geocities and MySpace. But I struggle to see how that will be next week or next month. It will be in many years.”

How I Added Scroll Snapping To My Twitter Timeline

CSS Scroll Snap allows websites to snap the web page or any other scroll container to a specific scroll position when the user performs a scrolling operation. This feature has been supported in all modern browsers for over two years, but many websites that could benefit from it are still not using it.

Scroll snapping is probably most associated with horizontal carousels (see Chris’s CSS-only approach) and particular web pages divided into full-screen slides. But why stop there? I believe that snapping can improve the scrolling experience on any web page that lays out items in a grid or feed.

For example, most shopping websites show products in a grid. Ideally, the user would like to jump between the grid rows with minimal effort. The user can press Space to scroll the page by roughly one screen (viewport height), but depending on the height of the grid rows, the scroll position will eventually get “out of sync” with the grid, and the user will have to re-adjust it manually.

If we add scroll snapping to this page, the user can consistently scroll to the next row with the Space key (pressing Shift + Space will scroll to the previous row). It’s pretty effortless.

I think that scroll snapping would be a welcome addition to this website. And it’s not even that complicated to implement. The CSS code that I used for this example is relatively simple:

html {
  scroll-snap-type: y proximity;
}

.product-item {
  scroll-snap-align: start;
  scroll-margin-top: 75px; /* height of web page’s sticky header */
}

You don’t have to wait if a website you visit regularly hasn’t yet added scroll snapping and you think it would improve your scrolling experience. You can add scroll snapping yourself — with user styles.

Adding user styles to websites

In the video above, you can see that I selected a user.css file in Safari’s advanced preferences. This file is a user style sheet. It contains CSS styles that I’ve written, stored in a local .css file, and added to Safari. These “user styles” are then applied to every web page I open in Safari.

Chrome and Firefox do not allow users to select a user style sheet. Firefox supported a similar feature called userContent.css in the past, but that feature was deprecated and disabled by default in 2019. I recommend the Stylus browser extension for these two browsers (and other Chromium-based browsers).

One significant advantage of Stylus is that it allows you to write user styles for specific websites and URLs. Safari’s user style sheet applies to all websites, but this can be worked around, e.g., by using the new :has() pseudo-class to create selectors that only match specific websites.

The Stylus extension has been reviewed by both Chrome and Firefox teams and received a badge that denotes high standards.

The CSS Cascading module defines a User Origin for styles the user adds. Safari’s user style sheet belongs to this origin, but the Stylus extension injects user styles to the Author Origin, where the website’s style sheets live. Specifically, Stylus inserts user styles directly to the page via a <style> element at the end of <html> which makes it the final style sheet on the page. Technically, this means styles added via Stylus are classified as author styles since they’re not in the User Origin, but I will continue to call them user styles because the user adds them.

However, it’s worth keeping this distinction in mind because it affects the cascade. When selector specificity is equal, a real user style is weaker than the page’s own style. This makes user styles an excellent fit for user defaults. Under the same conditions, a style added via Stylus is stronger than the page‘s style, so Stylus cannot as easily be used to define user defaults.

If we add !important to the mix, both real user styles and styles added via Stylus are stronger than the page’s styles. So when you want to impose your user styles on a website, it doesn’t matter if you use Safari’s “Style sheet” option or the Stylus extension. Your !important styles will win either way.

In the next section, I will use a set of !important user styles to enforce scroll snapping on the timeline page of Twitter’s website. My goal is to speed up the process of reading my Twitter timeline by avoiding awkward scroll positions where the topmost tweet is only partially on screen.

Scroll snap for Twitter’s timeline

After some experimentation, I’ve settled on the following CSS code. These styles work well in Firefox, but I’ve experienced some issues in Chrome and Safari. I will describe these issues in more detail later in the article, but for now, let’s focus on the behavior in Firefox.

html {
  scroll-snap-type: y mandatory !important;
}

/* tweets in the timeline are <article> elements */
article {
  scroll-snap-align: start !important;
}

/* un-stick the sticky header and make it “snappable” as well */
[aria-label="Home timeline"] > :first-child {
  position: static !important;
  scroll-snap-align: start !important;
}

/* hide the “new Tweets available” floating toast notification */
[aria-label="New Tweets are available."] {
  display: none !important;
}

It is necessary to add !important to each declaration because all the user styles must win over the web page’s own styles for our custom scroll snapping implementation to work correctly. I wish that instead of repeatedly writing !important, I could just put my user styles in an “important layer,” but such a CSS feature does not exist (yet).

Watch the video below to see my scroll snap user styles in action. Notice how each press on the Space key scrolls the next set of tweets into view, and the first tweet of each set is aligned to the top edge of the viewport. This allows me to read my timeline more quickly. When I need to go back to the previous set of tweets, I can press Shift + Space.

What I like about this type of scroll snapping is that it allows me to predict how far the page will scroll whenever I press Space. Each scroll distance equals the combined heights of the visible tweets that are entirely on the screen. In other words, the partially visible tweet at the bottom of the screen will move to the top of the screen, which is precisely what I want.

I know in advance that pressing Space will scroll Dave’s tweet to the top of the screen.

To try out my scroll snap user styles on your own Twitter timeline, follow these steps:

  1. Install the Stylus extension with Firefox Add-ons or the Chrome Web Store.
  2. Navigate to your Twitter timeline at https://twitter.com/home.
  3. Click the Stylus icon in the browser’s toolbar and click “this URL” in the pop-up.
  4. Stylus will open a code editor in a new browser tab. Copy-paste my scroll snap user styles into the editor and press the Save button in the sidebar on the left. The styles will be applied to your Twitter timeline immediately (no need to reload the page).
  5. You can update the styles at any time. Click the Stylus icon and the Pencil icon to open the editor again.

Inability to override snapping

My implementation of scroll snapping for Twitter’s timeline has one major flaw. If a tweet is taller than the viewport, it is impossible to scroll the page to reveal the bottom part of that tweet (e.g., if you want to like or retweet that tweet) because the browser forcefully snaps the page to show the top of the tweet (or the top of the following tweet).

The severity of this problem depends on the user’s display. Viewing Twitter’s timeline on a large desktop monitor at a small page zoom factor, you may not encounter any tweets taller than the viewport.

I have asked the CSS Working Group if it would be possible to add a mechanism allowing the user to override the browser’s mandatory scroll snapping. I should probably mention that this problem could, at least in theory, be resolved by switching from mandatory to proximity snapping. I’ve tested proximity snapping in Chrome and Firefox, and I found it inconsistent and confusing. The browser would often snap when I didn’t expect it to, and vice versa. Maybe Twitter’s code is interfering with the proximity algorithm, the browsers are still a bit buggy, or perhaps I’m just “scrolling it wrong,” if that’s even possible. I don’t know.

But the main reason why I went with mandatory snapping is that I wanted to avoid situations where the topmost tweet is only partially on screen after a scroll. The type of fast-scrolling between sets of tweets that I’ve shown in the video above is only possible with mandatory snapping.

If you, like me, prefer mandatory snapping, I can suggest the following two workarounds for the “tall tweet” problem:

  • You can open the tweet on its own page and return to the timeline afterward.
  • If you only want to click the Like or Retweet buttons, you can Shift-click the tweet to select it and then press L to like it, or T followed by Enter to retweet it.

Issues in Chrome and Safari

My scroll snap user styles produce noticeably different scroll snapping behaviors in Chrome, Safari, and Firefox. Those differences are in part since the exact implementation of the snapping mechanism is left up to the browser:

The CSS Scroll Snap Module intentionally does not specify nor mandate any precise animations or physics used to enforce snap positions; this is left up to the user agent.

The current version of Safari has a bug that prevents scroll snapping from working correctly on the Twitter timeline. I have reported this bug.

In Chrome, I have encountered the following problems:

  • The scrolling operations animate inconsistently. Sometimes the animation is slow, sometimes it’s instant, and sometimes it starts slow but is then cut short. I found this irritating.
  • The scrolling operations animate too slowly in general. I performed a test in Chrome and Firefox (20 Space presses), and it took me 70% more time to cover the same distance on my Twitter timeline in Chrome than in Firefox (18.5 seconds in Chrome vs. 11 seconds in Firefox).
  • When I scroll using my laptop’s trackpad, the page flickers a lot. When I attempt to scroll fast by holding down the Space key, the page scrolls very slowly and oscillates. I suspect that both issues are caused by the same algorithm. It seems that Chrome re-snaps at a very high rate in these cases. I have reported this bug.

These browser bugs and differences between browsers can be a problem for websites considering implementing scroll snapping. For example, a web developer might hold back because they don’t like how scroll snapping behaves in one particular browser. Browsers can mitigate this problem by becoming more interoperable. In fact, Scroll Snap is one of the areas of focus of the cross-browser Interop 2022 effort.

Another way the situation could be improved is by introducing new CSS properties that would make scroll snapping more configurable. This could include the duration of the snapping animation, the length of the proximity threshold for snapping, and a mechanism to override mandatory snapping.

To snap or not to snap?

I’ve been using my scroll snap user styles on Twitter’s timeline for a couple of weeks, and I don’t want to go back. The ability to quickly flip through my feed with only the Space key is just on another level.

However, I consider this an advanced feature that probably isn’t for everyone. There’s a reason why I’ve enabled it only on the timeline (/home path) and nowhere else on Twitter’s website. Snapping is a significant change in how the page scrolls, and it takes some time to get used to. It can work great for a specific use case, but it can also get in the way and frustrate the user.

Websites with feeds should therefore consider offering scroll snapping only as an optional feature, after careful consideration and plenty of testing in different browsers and with different input methods (mouse, keyboard, trackpad, touch screen, etc.).

Before you go…

Finally, I highly recommend installing and trying out the Stylus browser extension. Web developers (or anyone who knows CSS) have the power to style any website in their browser. You can apply minor improvements and fixes to your favorite websites. I mostly use it to hide page elements that I find annoying, such as sticky headers, video pop-ups, and vote counts.

But more importantly, Stylus allows you to quickly test new CSS features on any website and report browser bugs, if necessary. By doing this, you can help make the web platform a little better.


How I Added Scroll Snapping To My Twitter Timeline originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

How to Scale Engineering Processes w/ Twitter’s VP of Engineering

Maria Gutierrez is the VP of Engineering for Strategy and Operations at Twitter. She joins a special livestream of the Dev Interrupted podcast to share her career journey, her strategies for sustainably scaling engineering teams and the three pillars of engineering processes. 

In a first for the Dev Interrupted podcast, I hosted this episode live in front of a virtual audience during the INTERACT engineering leadership conference. Maria was a fantastic guest, sticking around after her interview to take questions from the audience. Her lessons on team management, building company culture, hiring and mentorship are not to be missed!

Crosspost Tweets to LinkedIn With Power Automate

Do you want your LinkedIn audience to know what you are up to on Twitter? Here's how I have set up Power Automate to crosspost specific tweets to LinkedIn.

What is Power Automate

Power Automate is one of the products of the Microsoft Power Platform family. It is a web-based service that helps you create automated workflows between your favorite apps and services to synchronize files, get notifications, collect data, and more. Power Automate is available as part of the Office 365 suite and is available in most Office 365 subscriptions.

How to Embed Facebook Status Posts in WordPress

Are you looking for a way to embed Facebook status posts in WordPress?

Facebook statuses are an easy way to share important updates and time-sensitive information with your audience. By embedding your Facebook timeline in WordPress, you can get more engagement, let people know what’s happening on your Facebook page or group, and grow your followers.

In this article, we will show you how to embed Facebook status posts in WordPress.

How to embed Facebook status posts in WordPress

Why Embed Facebook Status in WordPress?

Facebook is the most popular social media platform in the world and has billions of active users. For website owners, Facebook is a powerful way to connect with a new audience and engage with the people who already know about your brand.

Facebook is also perfect for sharing time-sensitive information in real time. In this way, you can use FOMO to create a sense of urgency.

For example, you might post a status about how visitors are running out of time to enter your giveaway in WordPress, or take advantage of your flash sale.

However, people won’t see your Facebook status if they just visit your website. This makes it difficult to grow your Facebook following and build a relationship with your audience.

By embedding your Facebook status posts in WordPress, you can promote your social media page and encourage more people to follow you on Facebook.

As you post new statuses, they’ll appear on your site automatically, so it’s also a great way to keep your website fresh, even for regular visitors.

That being said, let’s see how to embed Facebook status posts in WordPress.

Adding a Facebook Status Plugin to WordPress

The easiest way to embed your Facebook status feed in WordPress is by using the free Smash Balloon Social Post Feed.

This plugin lets you display text and links from your Facebook page or group.

A Facebook post timeline, embedded on a WordPress website.

In this guide, we’ll be using the free version of Smash Balloon as it allows you to embed Facebook statuses no matter what your budget. However, there’s Smash Balloon Facebook Feed that lets you embed different kinds of content. For example, you can embed a Facebook video in WordPress, and show images and videos in a lightbox popup on your site.

The first thing you need to do is install and activate the Smash Balloon Social Post Feed plugin. For more details, see our guide on how to install a WordPress plugin.

After that, you’ll need to connect Smash Balloon to your Facebook page or group, by going to Facebook Feed » All Feeds. Here, click on ‘Add New.’

How to create a custom Facebook feed

Smash Balloon pro lets you show posts from your photo albums, timeline, events, and more.

However, the free version only allows you to embed your Facebook statuses so click on ‘Timeline’ and then select ‘Next.’

The free Smash Balloon WordPress plugin

Now, you need to select the page or group which you’ll get the Facebook statuses from.

To get started, click on ‘Add New.’

Adding a Facebook page or group to your WordPress website

On the next screen, choose whether you want to embed the feed from a Facebook group or Facebook page.

After that, go ahead and click on ‘Connect to Facebook.’

How to connect a Facebook page or group to a WordPress website

This opens a popup where you can log into your Facebook account and choose the pages or groups which you want to get the status updates from.

As soon as you’ve done that, click on ‘Next.’

Giving Smash Balloon access to your Facebook posts

Facebook will then show all the information that Smash Balloon will have access to and the actions it can perform.

To restrict Smash Balloon’s access to your Facebook account, just click any of the switches to turn it from ‘Yes’ to ‘No.’ Just be aware that this may affect the content that you can embed on your WordPress blog or website.

With that in mind, it’s a good idea to leave all the switches enabled.

Connecting Facebook and WordPress using a free plugin

When you’re happy with how your Facebook permissions are set up, click on ‘Done.’

After a few moments, you should see a message confirming that you’ve connected your WordPress website to Facebook. With that done, click on the ‘OK’ button.

Connecting Smash Balloon and Facebook successfully

Smash Balloon will now take you back to the WordPress dashboard automatically.

How to Embed Facebook Status Posts in WordPress

You will now see a popup with the source you just linked to your website. Simply select the radio button next to your Facebook page or group and then click on the ‘Add’ button.

Selecting a page or group as your Facebook source

If you accidentally closed the popup, then don’t worry. You can simply refresh the tab to reopen the popup.

After that, Smash Balloon will take you back to the Facebook Feed » All Feeds page automatically. Just like before, click on the ‘Add New’ button, select ‘Timeline,’ and then click on the ‘Next’ button.

Now, select your Facebook page or group, and click on ‘Next.’

Embedding Facebook status posts in WordPress

Smash Balloon will now go ahead and create a timeline feed from the Facebook page or group you’ve chosen.

This is a good start, but Smash Balloon has lots of settings that you can use to customize your embedded timeline.

How to Customize Your Embedded Facebook Status Posts

To fine-tune your timeline, go to Facebook Feed » All Feeds in the WordPress dashboard.

Here, find the timeline feed you just created and click on the ‘Edit’ button next to it.

Customizing the Facebook status timeline feed

This opens the Smash Balloon feed editor, which shows a preview of your timeline to the right.

On the left-hand side, you’ll see all the different settings you can use to customize how the timeline looks on your site. Most of these settings are self-explanatory, but we’ll quickly cover all the main areas.

Customizing Facebook status posts in WordPress

To start, you can change how the statuses are displayed by clicking on ‘Feed Layout.’

On this screen, you can switch between list and masonry layouts, as well as change the feed height. As you make changes, the preview will update automatically so you can try different settings to see what looks the best for your website.

Smash Balloon's Feed Layout settings

You can preview how your status feed will look on desktop computers, tablets, and smartphones using the row of buttons in the upper-right corner.

Mobile devices usually have smaller screens and less processing power, so if you’re not happy with how the feed looks then it’s smart to show fewer statuses on tablets and smartphones.

Testing your Facebook post status on mobile devices

To make this change, just type a different number into the ‘Mobile’ field in the ‘Number of Posts’ section.

By trying out different layouts you can create a Facebook status feed that looks great across all devices.

How to create a responsive social media layout for mobile

By default, Smash Balloon feed shows fewer columns on smartphones and tablets, compared to desktop computers. This helps your Facebook statuses fit comfortably on smaller screens.

After testing the mobile version of your WordPress website, you may want to show fewer columns on smartphones and tablets.

To do this, simply change the numbers under ‘Columns.’

Adding and removing columns in a Facebook status feed

When you’re happy with how the feed looks, click on the ‘Customize’ link.

This will take you back to the main Smash Balloon editor, ready for you to explore the next settings screen, which is ‘Color Scheme.’

Changing the color scheme in your Facebook status feed

Smash Balloon uses a color scheme inherited from your WordPress theme by default, but on this screen, you can switch to a ‘Light’ or ‘Dark’ look.

You can also create your own color scheme by selecting ‘Custom’ and then using the controls to change the text color in WordPress, change the background color, and more.

Creating a custom color scheme using Smash Balloon

By default, Smash Balloon adds a header to your feed, which is your Facebook profile picture and the name of the group or page.

To customize this section, click on ‘Header’ in the left-hand menu.

Changing the Facebook custom feed header

Here, you can change the header size and color, hide your Facebook profile picture, and more.

If you would prefer to remove the header entirely, then click to turn off the ‘Enable’ toggle.

Adding a header to the Facebook status feed

Next, you can change how the individual posts look inside your feed by selecting ‘Post Style’ from the left-hand menu.

After that, click on ‘Post Style’ again.

Customizing a Facebook status feed with Smash Balloon

On this screen, you can choose between a regular and boxed layout.

If you select ‘Boxed’ then you can create a colored background for each Facebook post.

Adding colored box backgrounds to your embedded Facebook post statuses

If you choose ‘Regular’ then you can change the thickness and color of the line that separates your different social media posts.

In the following image, we’ve added a thicker line to our Facebook status feed.

Adding borders to a Smash Balloon Facebook feed

You can also customize the individual parts within each status by going back to the main settings screen.

Once again, select ‘Post Style’ but this time choose ‘Edit Individual Elements’ instead.

Customizing the posts inside a Facebook status feed

You will now see a list of all the different content that Smash Balloon includes in each post, such as the date, post author, and event title.

To remove a piece of content from your feed, simply click to uncheck its box.

How to remove content from a live Facebook feed

You can also customize how each type of content looks by clicking on it.

For example, in the following image, you can see settings to change the size and color of the author text.

Customizing how the post author is displayed in WordPress

By default, Smash Balloon doesn’t include the Facebook ‘like’ button in your feed.

This button makes it easier for visitors to follow you on Facebook, so you may want to add it to your status feed by selecting the ‘Like Box’ settings.

Adding a like button to the Facebook status feed

After that, simply click on the ‘Enable’ button so that it turns blue.

You can now use the settings to change where the link box appears and the kind of content included in the box, such as your Facebook cover photo and total number of followers.

Adding a like button to an embedded Facebook status page

If you upgrade to Smash Balloon premium, then there are some more settings to explore. This includes a lightbox feature that allows visitors to explore your content in a popup.

Since you’re using the free version of Smash Balloon for now, you can go ahead and click on ‘Save’ to store your changes.

The next step is adding the Facebook status feed to your WordPress website.

How to Embed Facebook Status Posts in WordPress

You can add your Facebook status feed to WordPress using a block, widget, or shortcode.

If you’ve created more than one feed using Smash Balloon, then you’ll need to know the feed’s code if you’re going to add it using a block or widget.

To get this information, simply go to Facebook Feed » All Feeds and then look at the feed="" part of the shortcode. You’ll need to add this code to the block or widget, so make a note of it.

In the following example, we’ll need to use feed="8".

Adding Facebook content to WordPress using a shortcode

If you want to embed your Facebook statuses in a page or post, then we recommend using the ‘Custom Facebook Feed’ block.

Simply open the page or post where you want to embed the status feed. Then, click on the ‘+’ icon to add a new block and start typing ‘Custom Facebook Feed.’

When the right block appears, click to add it to the post or page.

Adding a Facebook timeline to your website using a WordPress block

The block will show one of your Smash Balloon feeds by default. If you want to use a different feed instead, then simply find ‘Shortcode Settings’ in the right-hand menu.

You can now add the feed="" code to this box. Once you’ve done that, click on the ‘Apply Changes’ button.

Showing different Facebook feeds using shortcode

The block will now show all the status updates from your Facebook page or group. Just publish or update the page to make the feed live.

Another option is to add the feed to any widget-ready area, such as the sidebar or similar section. This allows visitors to see your latest Facebook updates across your entire website.

Simply go to Appearance » Widgets in the WordPress dashboard and then click on the blue ‘+’ button.

The Smash Balloon Custom Facebook Feed widget

Now, start typing ‘Custom Facebook Feed’ into the search bar to find the right widget.

You can now drag it onto the area where you want to show your Facebook status updates. By default, the widget will show one of the feeds you created using Smash Balloon.

Adding a social media widget to your WordPress website

To show a different feed instead, type the feed’s code into the ‘Shortcode Settings’ box and then click on ‘Apply Changes.’

You can now click on the ‘Update’ button to make the widget live.

How to publish a Facebook feed to your website

For more information, please see our step-by-step guide on how to add and use widgets.

Finally, you can embed your status on any page, post, or widget-ready area using a shortcode. To get the shortcode, simply go to Facebook Feed » All Feeds and copy the value in the ‘Shortcode’ column.

You can now add this code to your site. For more information, please see our detailed guide on how to add a shortcode in WordPress.

We hope this article helped you learn how to embed Facebook status posts in WordPress. You may also want to see our guide on how to create an email newsletter and the best WordPress Facebook plugins to grow your blog.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Embed Facebook Status Posts in WordPress first appeared on WPBeginner.

RediSearch in Action

Redis has a versatile set of data structures ranging from simple Strings all the way to powerful abstractions such as Redis Streams. The native data types can take you a long way, but there are certain use cases that may require a workaround. One example is the requirement to use secondary indexes in Redis in order to go beyond the key-based search/lookup for richer query capabilities. Though you can use Sorted Sets, Lists, and so on to get the job done, you’ll need to factor in some trade-offs.

Enter RediSearch! Available as a Redis module, RediSearch provides flexible search capabilities, thanks to a first-class secondary indexing engine. It offers powerful features such as full-text Search, auto completion, geographical indexing, and many more.

Jetpack 9.0 to Introduce New Feature for Publishing WordPress Posts to Twitter as Threads

Jetpack 9.0, coming on October 6, will debut a new feature that allows users to share blog posts as Twitter threads in multiples tweets. A recent version of Jetpack introduced the ability to import and unroll tweetstorms for publishing inside a post. The 9.0 release will run it back the other way so the content originates in WordPress, yet still reaps all the same benefits of circulation on Twitter as a thread.

The new Twitter threads feature is being added as part of Jetpack’s Publicize module under the Twitter settings. After linking up a Twitter account, the Jetpack sidebar options for Publicize allow users to publish to Twitter as a link to the blog or a set of threaded tweets. It’s not just limited to text content – the threads feature will also upload and attach any images and videos included in the post.

When first introduced to the idea of publishing a Twitter thread from WordPress, I wondered if threads might lose their trademark pithy punch, since users aren’t forced to keep each segment to the standard length of a tweet. Would each tweet be separated in an odd, unreadable way? The Jetpack team anticipated this, so the thread option adds more information to the block editor to show where the paragraphs will be split into multiple tweets.

“Threads are wildly underused on Twitter,” Gary Pendergast said in a post introducing the feature. “I think a big part of that is the UI for writing threads: while it’s suited to writing a thread as a series of related tweet-sized chunks, it doesn’t lend itself to writing, revising, and editing anything more complex.” The tool Pendergast has been working on for Jetpack gives users the best of both worlds.

In response to a comment requesting Automattic “concentrate on tools to get people off social media,” Pendergast said, “If we’re also able to improve the quality of conversations on social media, I think it’d be remiss of us to not do so.” He also credits IndieWeb discussions on Tweetstorms and POSSE (Publish (on your) Own Site, Syndicate Elsewhere) as inspirations for the feature.

For years, blogging advocates have tried to convince those who post lengthy tweetstorms to switch to a publishing medium that is more suitable to the length of their thoughts. The problem is that Twitter users lose so much of the immediate feedback and momentum that their thoughts would have generated when composed as a tweetstorm.

Instead of lecturing people about how they should really be blogging instead of tweetstorming, Jetpack is taking a fresh approach by enabling full content ownership with effortless social syndication. You can test out the experience for yourself by adding the Jetpack Beta Testers plugin and running the 9.0 RC version on your site.

9 Best Twitter Plugins for WordPress in 2024 (Compared)

We’ve been promoting our brands across social media platforms like Twitter for several years now, so we know how useful plugins can be for increasing followers, traffic, and shares.

However, not every Twitter plugin can handle every use case that your business might have. That’s why we’ve tested the best options on the market and paid attention to social features, user-friendliness, and price.

In this article, we will share the best Twitter plugins for WordPress that will help you grow your Twitter followers and engagement.

Best Twitter Plugins for WordPress (Compared)

If you are in a hurry, then you can take a look at our top picks to choose a WordPress Twitter plugin quickly.

#PluginBest ForPricing
🥇Smash Balloon Twitter FeedEmbedding Twitter feeds on your website$49/per year + Free
🥈RafflePressHosting Twitter giveaways and contests$39/per year + Free
🥉Uncanny AutomatorCreating automated workflows for Twitter$149/per year + Free

Why Use a Twitter Plugin for WordPress?

Twitter, also known as X, is one of the most popular social media platforms, with over 217 million monthly active users. Because of this, many WordPress sites and blogs use Twitter to reach new audiences and maximize their online presence.

With a WordPress Twitter plugin, you can quickly boost your social media marketing efforts. You can do things like:

  • Increase traffic by automatically sharing new blog posts on Twitter.
  • Add social proof by displaying a Twitter feed on your website.
  • Boost your Twitter followers by running a viral giveaway.
  • And more

That being said, let’s take a look at the best WordPress Twitter plugins that you can use.

Disclaimer: We have tested all the plugins in this list on our demo website to look at all their features, pros, and cons. This helped us give you only the best recommendations for Twitter plugins. For more details, you can see our WPBeginner editorial process.

1. Smash Balloon Twitter Feed (Twitter Feed Embeds)

Smash Balloon Twitter Feed Pro

Smash Balloon Twitter Feed is the best WordPress Twitter plugin on the market because it easily lets you embed your recent tweets in WordPress.

It allows you to display multiple Twitter feeds based on users, hashtags, keywords, or search terms, meaning you can also add tweets from public accounts to your website.

The Smash Balloon Twitter Feed plugin also has different customization and layout options like grids and carousels to help attractively display tweets.

Customizing the Twitter feed using Smash Balloon

For more information, see our tutorial on how to embed actual tweets in WordPress blog posts.

Additionally, the plugin lets you include retweets and replies, use advanced filters, and even allows you to display photos, videos, and Twitter cards to embed rich content on your blog.

Pros

  • Twitter Feed supports the default WordPress editor, and you can add your feed using a simple block.
  • It comes with a smart caching system that loads your feed easily.
  • Upon plugin testing, we found that it lets you showcase specific Twitter profiles on your website.
  • The plugin comes with reports and analytics features to track your Twitter feed performance.
  • Smash Balloon also offers social feed plugins for Instagram, Facebook, and YouTube.

Cons

  • The Twitter Feed plugin has a free plan. However, you will need to upgrade to the pro version to unlock advanced features.

Why we recommend Smash Balloon Twitter Feed: It is the best WordPress Twitter plugin on the market that allows you to easily embed recent tweets and your entire Twitter feed.

It comes with an easy-to-use builder, multiple layout templates, analytics, and a caching feature to load your feed quickly. If you want to display tweets on your site, then this plugin is the best choice for you.

For more information, you can see our complete Smash Balloon review.

2. RafflePress (Twitter Giveaways and Contests)

RafflePress

RafflePress is the best WordPress giveaway plugin on the market. It lets you set up contests with prizes that you can use to get more Twitter followers and engagement.

The plugin comes with a built-in campaign template for Twitter. This allows you to instantly launch contests aimed at boosting Twitter engagement.

Plus, it is incredibly easy to use and has a drag-and-drop content builder. All you have to do is add the actions you want to include in your contest and then add them to any WordPress post or page.

Add Twitter as an action in a giveaway

For detailed instructions, you can see our tutorial on how to run a social media contest to grow your site.

Pros

  • RafflePress is not just limited to Twitter. You can use it to grow your email list, increase Facebook likes, drive traffic and sales to your online store, and more.
  • When we tested the plugin, we realized that you can choose if you want users to share your content on Twitter, follow your account, or tweet a specific message to enter the contest.
  • RafflePress is completely mobile-friendly, meaning users can enter your contest directly from their mobile devices.
  • It ensures a smooth Twitter login experience for users and provides complete spam entry protection. Plus, it has an analytics feature.

Cons

  • You can use RafflePress Lite to get started with giveaways and contests. However, to unlock more Twitter actions, you must upgrade to the pro plan.
  • You cannot use the plugin to embed or share Twitter content on your website.

Why we recommend RafflePress: If you want to use your WordPress site as a platform to boost your Twitter following and activity, then RafflePress is the perfect choice for you. It lets you build amazing giveaways and contests that can drive traffic to your Twitter handle as well as boost engagement on your WordPress blog.

To learn more, just see our detailed RafflePress review.

3. Uncanny Automator (Twitter Automations)

Uncanny Automator website

Uncanny Automator is the best WordPress automation plugin. It lets you connect your website with over 150 applications, including Twitter, to create automated workflows without writing code.

You can easily connect the plugin with Twitter to send a new tweet when a blog post is published, a comment is posted, a new user registers on your site or to encourage visitors to post a tweet after an online course completion.

With Uncanny Automator, you are able to set these triggers and actions to create a recipe and also use conditional logic to control when and how your automation runs.

Choose your action for Twitter

For detailed information, you can see our tutorial on how to automate WordPress and social media with IFTTT and more.

Pros

  • Uncanny Automator’s recipe builder is super beginner-friendly. It provides unlimited recipes and actions.
  • You can use the plugin to send direct messages to Twitter users, mention specific users, reply to tweets, and post multimedia content.
  • It lets you connect with your personal or business Twitter account to create an automated workflow.
  • Uncanny Automator can monitor clicks, likes, and retweets directly.

Cons

  • It has a free plan, but you must buy the pro version to unlock advanced Twitter triggers and actions.
  • It cannot embed Twitter content on your website.

Why we recommend Uncanny Automator: It is the best automation plugin that can help drive traffic to your website using Twitter. This way, whenever something happens on your site, it will automatically be tweeted on your account, sending more traffic.

For details, you can also see our Uncanny Automator review.

4. All in One SEO For WordPress (Twitter Cards)

All in One SEO

All in One SEO for WordPress is the best SEO plugin on the market that allows you to add Twitter cards for your website content. These cards are the images and descriptions that appear on Twitter when someone shares your blog posts.

They can help boost the number of people following your Twitter accounts through content attribution.

Twitter card

AIOSEO also offers multiple Twitter card types and makes it super easy to link your website with your social media account. This allows Twitter to display your username and profile picture when sharing your content.

For details, you can see our tutorial on how to add Twitter cards in WordPress.

Pros

  • When we were testing the plugin, we realized that AIOSEO lets you link individual content to the author’s Twitter profiles.
  • The plugin offers other features like XML sitemaps, a broken link assistant, a headline analyzer, on-page SEO, and more.
  • It can act as a writing assistant and provide suggestions to improve your content.
  • Other than Twitter, you can also add Facebook cards with AIOSEO.

Cons

  • The plugin’s free plan has limited features.
  • It cannot add your Twitter feed to your website.

Why we recommend All in One SEO: If you are looking for a tool to add Twitter cards to your blog posts, then All in One SEO is the perfect choice for you. It’s also an excellent choice for improving your website’s overall SEO.

For details, you can see our AIOSEO review.

5. Shared Counts (Social Sharing)

Shared Counts

Shared Counts is one of the best social sharing plugins for WordPress that is designed for speed and performance without compromising on features.

As the name suggests, it allows you to display the share count for each social media platform, including Twitter. You can also display the total share count for each blog post.

Plus, you can add Twitter Share and Retweet buttons to make it easy for website visitors to share your content online.

Pros

  • Other than Twitter, you can also add share buttons for Facebook, Yummly, Pinterest, and LinkedIn.
  • There are multiple button styles to choose from, and you can also select the button location.
  • The plugin is super easy to use and helps you instantly add social features to your WordPress site without compromising website speed.
  • It helps offer social proof by displaying share counts.

Cons

  • When we were testing the plugin, we realized that it does not let you choose button positions.
  • Its analytics and reporting feature is basic compared to other tools on this list.

Why we recommend Shared Counts: If you want to encourage users to share your content or tweet about it on their Twitter accounts, then Shared Counts is the best Twitter plugin for you.

6. Social Warfare (Social Sharing)

Social Warfare

Social Warfare is another popular plugin for adding social sharing buttons to your website. It gives you complete control over what content your readers can share on Twitter (and other social networks) and how they share it.

The plugin offers multiple button styles, and they are all designed to work well on mobile devices. You can also style and position them in different ways and add sharing buttons in different parts of an article according to your liking.

While testing the plugin, we particularly liked that you can also add a customizable tweet box within your content.

Pros

  • It shows an accurate share count for each platform, including Facebook, Twitter, and LinkedIn.
  • Social Warfare improves shareability by setting content titles, descriptions, and images for social media.
  • The plugin prevents content theft and encourages social sharing by blurring post content on social networks until clicked.
  • Some of its advanced features include A/B testing, analytics, email sharing, automated scheduling, and more.

Cons

  • Social Warfare has a free version, but most of the advanced features can only be unlocked in the pro plan.
  • The plugin has a lot of features that can feel overwhelming for beginners.

Why we recommend Social Warfare: If you are looking for an advanced Twitter social sharing tool, then this plugin is for you. It lets you create an attractive button, prevents content theft, and improves the overall shareability of your content by setting custom titles, descriptions, and, images for Twitter.

7. Revive Old Posts (Re-Share Social Content)

Revive Old Posts

Revive Old Posts lets you easily share old articles at a pre-defined schedule on your social media profiles. This helps you keep your Twitter timeline active throughout the day without manually scheduling tweets.

Once you are done with the setup, it automatically works in the background to share your old posts. You can select a date range, exclude specific categories and tags, and pause it at any time.

With the help of the plugin, you can customize what goes out in the tweets, too. For instance, you might want to include a hashtag based on the post’s category or tag.

Pros

  • You can exclude specific posts from being shared on your Twitter account.
  • The plugin allows you to create unique tweets for each post with Spintax support for messages.
  • It comes with Open Graph Optimization for content shared on social media.
  • Revive Old Posts also has the ability to set custom schedules, use multiple Twitter accounts, and add conversion tracking tags to URLs.

Cons

  • Using the plugin to share older content can affect your site negatively because some of these posts may contain outdated information. In that case, you must ensure your article has relevant content.
  • Sharing too much old content can look like spam and drown out newer posts and announcements on Twitter.

Why we recommend Revive Old Posts: If you want to bring traffic to older posts and maintain your Twitter activity, then this Twitter plugin is a great option.

8. Simple Social Icons (Twitter Icons)

Simple Social Icons

The Simple Social Icons plugin makes it easy to add social media icons to a sidebar widget. These icons have links to your Twitter profile and other social media platforms. Visitors to your site can then easily find and follow you on their favorite social networks.

It is quite simple and easy to set up. You have the option to choose the button colors, alignment, and order. It comes with an easy-to-use widget that you can simply add to your WordPress blog.

Pros

  • If you don’t want to add social media icons to a widget area, then you can also add them to pages or posts using a shortcode.
  • The plugin lets you configure icon settings so that the social media will open in a new tab when a user clicks the button.
  • It has custom URL support, Font Awesome integration, floating icons, and email sharing.
  • The plugin can also display share counts next to social media icons.

Cons

  • During our research, we discovered that the plugin does not have great customer support.
  • It comes with basic customization options.

Why we recommend Simple Social Icons: If you are looking for a free solution to add Twitter, Facebook, or Instagram share buttons to your website, then this plugin is for you.

9. Better Click to Tweet (Tweet Boxes)

Better Click to Tweet

Better Click to Tweet is a free plugin that lets you add ‘click to tweet’ boxes in your posts.

You can use this plugin to highlight specific quotes in your content. Your visitors can then simply click a button to tweet that quote. For more details, just see our guide on adding click-to-tweet boxes in your content.

Plus, it’s fully compatible with the WordPress block editor and also offers a shortcode that you can use to add the click-to-tweet box to your preferred place on your website.

Pros

  • The plugin comes with multiple pre-designed styles for your click-to-tweet box.
  • It allows you to shorten your URLs, open Twitter in a new tab, and monitor click-to-tweet engagement.
  • Some of the plugin’s advanced features include button customization, share counts, A/B testing, click triggers, and more.

Cons

  • The tracking and analytics feature is basic compared to other tools on this list. The advanced features can only be unlocked in the pro version.
  • The plugin has a bit of a learning curve.

Why we recommend Better Click to Tweet: If you want to add a click-to-tweet box that visitors can use to highlight specific website content on Twitter, then this plugin is for you.

Which Is the Best WordPress Twitter Plugin?

In our expert opinion, Smash Balloon Twitter Feed is the best WordPress Twitter plugin on the market because it lets you easily embed your Twitter feeds on your website.

It comes with an easy-to-use builder, smart caching system, reports and analytics, and multiple layout templates, making it a great choice.

However, if you want to boost your social media following, then you can use RafflePress instead. It lets you easily host contests on your website and encourages users to follow you on Twitter to enter the competition.

On the other hand, you can also opt for Uncanny Automator to automatically create tweets every time something exciting happens on your site like new posts, new comments, user registrations, and more.

Additionally, you can use AIOSEO to add Twitter cards to your WordPress blog posts.

If you just want to add a simple share button for Twitter, then Shared Counts is a good choice as well.

Frequently Asked Questions About WordPress Twitter Plugins

Here are some questions that are frequently asked by our readers about Twitter plugins:

What is the best free Twitter plugin for WordPress?

Most of the Twitter plugins in our list have free plans that you can use if you are on a budget.

For example, Smash Balloon Twitter Feed is the best Twitter plugin and it offers a free version to help embed your Twitter feed to your website.

Similarly, RafflePress can also be used to host giveaways and boost Twitter followers for free. You can even add a Twitter social sharing button with a free plugin like Shared Counts.

Can I schedule tweets to be posted automatically?

You can easily schedule tweets to be posted automatically using Uncanny Automator.

It is the best automation plugin that lets you create a recipe for automatically posting a tweet upon a new blog post publication, user registration, new comments, and so much more.

What are the different types of Twitter plugins?

Different types of Twitter plugins perform different actions, and you can choose the one that you need for your website. Some kinds of Twitter plugins include:

  • Feed Display: These plugins can embed entire timelines, specific tweets, hashtags, keywords, and feeds on your website, like Smash Balloon Twitter Feed.
  • Social Sharing: These plugins can add share buttons and share counts to encourage Twitter sharing of your content, like Social Warfare or Shared Counts.
  • Auto Posting: Some plugins, like Revive Old Posts and Uncanny Automator, automatically publish WordPress posts to Twitter.
  • Contests & Giveaways: Plugins like RafflePress let you run Twitter-based contests to attract followers.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 9 Best Twitter Plugins for WordPress in 2024 (Compared) first appeared on WPBeginner.

Twitter’s Reliability Journey

Twitter’s SRE team is one of the most advanced in the industry, managing the services that capture the pulse of the world every single day, and throughout the moments that connect us all. We had the privilege of interviewing Brian Brophy, Sr. Staff SRE, Carrie Fernandez, Head of Site Reliability Engineering, JP Doherty, Engineering Manager, and Zachary Kiehl, Sr. Staff SRE to learn about how SRE is practiced at Twitter.

As a company, Twitter is approximately 4,800 employees strong with offices around the world. SRE has been part of the engineering organization formally since 2012, though foundational practices around reliability and operations began emerging earlier. Today, SRE at Twitter features both embedded and core/central engagement models, with team members that hold the SRE title as well as those without but who perform SRE responsibilities. Regardless of their role or title, a key mantra among those who care about reliability is “let’s break things better the next time.” 

The Best Twitter Search Tricks

The Twitter Archiver and the Twitter Bots app fire each time a new tweet is found that match your search query. You can write simple search queries (like #Oscars) or more complex query (like obama min_retweets:10 filter:news) that uses one or more Twitter’s advanced search operators.

Twitter Search

How to Search Twitter Like a Pro

Here’s a complete list of Twitter search operators that can help you perform more accurate searches on Twitter:

from:BillGates - All tweets sent by a particular Twitter user.

filter:verified cool OR amazing - Only show tweets from verified Twitter accounts (with the blue tick).

iPhone near:NY within:10mi - Tweets sent by users within the 10 mile radius of New York containing iPhone.

iPhone Reviews since:2020-08-20 until:2020-09-20 - Tweets sent in a particular time range (may not work with Twitter APIs).

gangnam style filter:replies - Only show tweets that are replies. You can use exclude:replies to remove @reply tweets from search results.

gangnam style filter:retweets - Only show tweets that are retweets. You can use exclude:retweets to remove RTs from search results.

to:BarackObama -filter:links - Tweets sent to @BarackObama but not containing any links.

elections list:TIME/time-staff - Search for tweets from users who belong to a particular Twitter list.

youtube.com min_faves:100 - Tweets containing YouTube videos that are favorited by at least 100 users.

earthquake min_retweets:10 - Tweets that have been retweeted at least 10 times.

Also see: Twitter Archiver for Google Sheets

#foodrecipe lang:en - Tweets sent in particular language (en = English).

YouTube good OR amazing OR awesome filter:links - Tweets containing YouTube videos that are described as awesome or amazing.

#Emmys filter:images - Show tweets for a particular hashtag but containing images.

Coronavirus filter:news - Show only tweets that mention a keyword and contain links to news websites.

from:john to:peter -RT - Tweets from user @John that @mention user @Peter but exclude Retweets.

family games filter:safe - Filter tweets containing adult or potentially sensitive content.

tornado filter:media - Show tornado tweets containing images or videos.

music concert filter:native_video - Show tweets that contain native video (uploaded inside tweet).

twitter search tricks

The engagement filter inside Tweetdeck surfaces the best tweets and removes the noise from Twitter search results but the most surprising part is that Twitter has not made this filter available outside Tweetdeck. You don’t even have it inside the official Twitter app.

Well, here’s the trick. You can actually filter tweets by engagement level on the Twitter website or inside any Twitter app using an undocumented search operator that Twitter doesn’t want us to know about.

Go to the Twitter search box, type any search term and append the operator min_retweets:[number] or min_faves:[number] to filter your search results. For instance, here’s a sample search that will only show tweets pointing to the labnol.org domain that has been favorited or retweeted at least 5 times.

Rethinking Twitter as a Serverless App

In a previous article, we showed how to build a GraphQL API with FaunaDB. We’ve also written a series of articles [1, 2, 3, 4] explaining how traditional databases built for global scalability have to adopt eventual (vs. strong) consistency, and/or make compromises on relations and indexing possibilities. FaunaDB is different since it does not make these compromises. It’s built to scale so it can safely serve your future startup no matter how big it gets, without sacrificing relations and consistent data.

In this article, we’re very excited to start bringing all of this together in a real-world app with highly dynamic data in a serverless fashion using React hooks, FaunaDB, and Cloudinary. We will use the Fauna Query Language (FQL) instead of GraphQL and start with a frontend-only approach that directly accesses the serverless database FaunaDB for data storage, authentication, and authorization.


The golden standard for example applications that feature a specific technology is a todo app–mainly because they are simple. Any database out there can serve a very simple application and shine. 

And that is exactly why this app will be different! If we truly want to show how FaunaDB excels for real world applications, then we need to build something more advanced. 

Introducing Fwitter

When we started at Twitter, databases were bad. When we left, they were still bad

Evan Weaver

Since FaunaDB was developed by ex-Twitter engineers who experienced these limitations first-hand, a Twitter-like application felt like an appropriately sentimental choice. And, since we are building it with FaunaDB, let’s call this serverless baby ‘Fwitter’

Below is a short video that shows how it looks, and the full source code is available on GitHub.

When you clone the repo and start digging around, you might notice a plethora of well-commented example queries not covered in this article. That’s because we’ll be using Fwitter as our go-to example application in future articles, and building additional features into it with time. 

But, for now, here’s a basic rundown of what we’ll cover here:

We build these features without having to configure operations or set up servers for your database. Since both Cloudinary and FaunaDB are scalable and distributed out-of-the-box, we will never have to worry about setting up servers in multiple regions to achieve low latencies for users in other countries. 

Let’s dive in!

Modeling the data 

Before we can show how FaunaDB excels at relations, we need to cover the types of relations in our application’s data model. FaunaDB’s data entities are stored in documents, which are then stored in collections–like rows in tables. For example, each user’s details will be represented by a User document stored in a Users collection. And we eventually plan to support both single sign-on and password-based login methods for a single user, each of which will be represented as an Account document in an Accounts collection.

At this point, one user has one account, so it doesn’t matter which entity stores the reference (i.e., the user ID). We could have stored the user ID in either the Account or the User document in a one-to-one relation:

One-to-one

However, since one User will eventually have multiple Accounts (or authentication methods), we’ll have a one-to-many model.

One-to-many

In a one-to-many relation between Users and Accounts, each Account points to only one user, so it makes sense to store the User reference on the Account:

We also have many-to-many relations, like the relations between Fweets and Users, because of the complex ways users interact with each other via likes, comments, and refweets. 

Many-to-many

Further, we will use a third collection, Fweetstats, to store information about the interaction between a User and a Fweet.

Fweetstats’ data will help us determine, for example, whether or not to color the icons indicating to  the user that he has already liked, commented, or refweeted a Fweet. It also helps us determine what clicking on the heart means: unlike or like.

The final model for the application will look like this: 

The application model of the fwitter application

Fweets are the center of the model, because they contain the most important data of the Fweet such as the information about the message, the number of likes, refweets, comments, and the Cloudinary media that was attached. FaunaDB stores this data in a json format that looks like this: 

As shown in the model and in this example json, hashtags are stored as a list of references. If we wanted to, we could have stored the complete hashtag json in here, and that is the preferred solution in more limited document-based databases that lack relations. However, that would mean that our hashtags would be duplicated everywhere (as they are in more limited databases) and it would be more difficult to search for hashtags and/or retrieve Fweets for a specific hashtag as shown below.

Note that a Fweet does not contain a link to Comments, but the Comments collection contains a reference to the Fweet. That’s because one Comment belongs to one Fweet, but a Fweet can have many comments–similar to the one-to-many relation between Users and Accounts.

Finally, there is a FollowerStats collection which basically saves information about how much users interact with each other in order to personalize their respective feeds. We won’t cover that much in this article, but you can experiment with the queries in the source code and stay tuned for a future article on advanced indexing.

Hopefully, you’re starting to see why we chose something more complex than a ToDo app. Although Fwitter  is nowhere near the complexity of the real Twitter app on which it’s based, it’s already becoming apparent that implementing such an application without relations would be a serious brainbreaker. 

Now, if you haven’t already done so from the github repo, it’s finally time to get our project running locally!

Setup the project

To set up the project, go to the FaunaDB dashboard and sign up. Once you are in the dashboard, click on New Database, fill in a name, and click Save. You should now be on the “Overview” page of your new database. 

Next, we need a key that we will use in our setup scripts. Click on the Security tab in the left sidebar, then click the New key button. 

In the “New key” form, the current database should already be selected. For “Role”, leave it as “Admin”. Optionally, add a key name. Next, click Save and copy the key secret displayed on the next page. It will not be displayed again.

Now that you have your database secret, clone the git repository and follow the readme. We have prepared a few scripts so that you only have to run the following commands to initialize your app, create all collections, and populate your database. The scripts will give you further instructions:

// install node modules
npm install
// run setup, this will create all the resources in your database
// provide the admin key when the script asks for it. 
// !!! the setup script will give you another key, this is a key
// with almost no permissions that you need to place in your .env.local as the
// script suggestions

npm run setup
npm run populate
 
// start the frontend

After the script, your .env.local file should contain the bootstrap key that the script provided you (not the admin key)

REACT_APP_LOCAL___BOOTSTRAP_FAUNADB_KEY=<bootstrap key>

You can optionally create an account with Cloudinary and add your cloudname and a public template (there is a default template called ‘ml_default’ which you can make public) to the environment to include images and videos in the fweets. 

REACT_APP_LOCAL___CLOUDINARY_CLOUDNAME=<cloudinary cloudname>
REACT_APP_LOCAL___CLOUDINARY_TEMPLATE=<cloudinary template>

Without these variables, the include media button will not work, but the rest of the app should run fine:

Creating the front end

For the frontend, we used Create React App to generate an application, then divided the application into pages and components. Pages are top-level components which have their own URLs. The Login and Register pages speak for themselves. Home is the standard feed of Fweets from the authors we follow; this is the page that we see when we log into our account. And the User and Tag pages show the Fweets for a specific user or tag in reverse chronological order. 

We use React Router to direct to these pages depending on the URL, as you can see in the src/app.js file.

<Router>
  <SessionProvider value={{ state, dispatch }}>
    <Layout>
      <Switch>
        <Route exact path="/accounts/login">
          <Login />
        </Route>
        <Route exact path="/accounts/register">
          <Register />
        </Route>
        <Route path="/users/:authorHandle" component={User} />
        <Route path="/tags/:tag" component={Tag} />
        <Route path="/">
          <Home />
        </Route>
      </Switch>
    </Layout>
  </SessionProvider>
</Router>

The only other thing to note in the above snippet is the SessionProvider, which is a React context to store the user’s information upon login. We’ll revisit this in the authentication section. For now, it’s enough to know that this gives us access to the Account (and thus User) information from each component.

Take a quick look at the home page (src/pages/home.js) to see how we use a combination of hooks to manage our data. The bulk of our application’s logic is implemented in FaunaDB queries which live in the src/fauna/queries folder. All calls to the database pass through the query-manager, which in a future article, we’ll refactor into serverless function calls. But for now these calls originate from the frontend and we’ll secure the sensitive parts of it with FaunaDB’s ABAC security rules and User Defined Functions (UDF). Since FaunaDB behaves as a token-secured API, we do not have to worry about a limit on the amount of connections as we would in traditional databases. 

The FaunaDB JavaScript driver

Next, take a look at the src/fauna/query-manager.js file to see how we connect FaunaDB to our application using FaunaDB’s JavaScript driver, which is just a node module we pulled with `npm install`. As with any node module, we import it into our application as so:

import faunadb from 'faunadb'

And create a client by providing a token. 

this.client = new faunadb.Client({
  secret: token || this.bootstrapToken
})

We’ll cover tokens a little more in the Authentication section. For now, let’s create some data! 

Creating data

The logic to create a new Fweet document can be found in the src/fauna/queries/fweets.js file. FaunaDB documents are just like JSON, and each Fweet follows the same basic structure: 

const data = {
  data: {
   message: message,
   likes: 0,
   refweets: 0,
   comments: 0,
   created: Now()
  }
}

The Now() function is used to insert the time of the query so that the Fweets in a user’s feed can be sorted chronologically. Note that FaunaDB automatically places timestamps on every database entity for temporal querying. However, the FaunaDB timestamp represents the time the document was last updated, not the time it was created, and the document gets updated every time a Fweet is liked; for our intended sorting order, we need the created time. 

Next, we send this data to FaunaDB with the Create() function. By providing Create() with the reference to the Fweets collection using Collection(‘fweets’), we specify where the data needs to go. 

const query = Create(Collection('fweets'), data )

We can now wrap this query in a function that takes a message parameter and executes it using client.query() which will send the query to the database. Only when we call client.query() will the query be sent to the database and executed. Before that, we combine as many FQL functions as we want to construct our query. 

function createFweet(message, hashtags) {
   const data = …
   const query = …
   return client.query(query)
}

Note that we have used plain old JavaScript variables to compose this query and in essence just called functions. Writing FQL is all about function composition; you construct queries by combining small functions into larger expressions. This functional approach has very strong advantages. It allows us to use native language features such as JavaScript variables to compose queries, while also writing higher-order FQL functions that are protected from injection.

For example, in the query below, we add hashtags to the document with a CreateHashtags() function that we’ve defined elsewhere using FQL.

const data = {
  data: {
    // ...
    hashtags: CreateHashtags(tags),
    likes: 0,
    // ... 
}

The way FQL works from within the driver’s host language (in this case, JavaScript) is what makes FQL an eDSL (embedded domain-specific language). Functions like CreateHashtags() behave just like a native FQL function in that they are both just functions that take input. This means that we can easily extend the language with our own functions, like in this open source FQL library from the Fauna community. 

It’s also important to notice that we create two entities in two different collections, in one transaction. Thus, if/when things go wrong, there is no risk that the Fweet is created yet the Hashtags are not. In more technical terms, FaunaDB is transactional and consistent whether you run queries over multiple collections or not, a property that is rare in scalable distributed databases. 

Next, we need to add the author to the query. First, we can use the Identity() FQL function to return a reference to the currently logged in document. As discussed previously in the data modeling section, that document is of the type Account and is separated from Users to support SSO in a later phase.

Then, we need to wrap Identity() in a Get() to access the full Account document and not just the reference to it.

Get(Identity()) 

Finally, we wrap all of that in a Select() to select the data.user field from the account document and add it to the data JSON. 

const data = {
  data: {
    // ...
    hashtags: CreateHashtags(tags),
    author: Select(['data', 'user'], Get(Identity())),
    likes: 0,
    // ...
  }
}

Now that we’ve constructed the query, let’s pull it all together and call client.query(query) to execute it.

function createFweet(message, hashtags) {
 const data = {
   data: {
     message: message,
     likes: 0,
     refweets: 0,
     comments: 0,
     author: Select(['data', 'user'], Get(Identity())),
     hashtags: CreateHashtags(tags),
     created: Now()
   }
 }
 
 const query = Create(Collection('fweets'), data )
 return client.query(query)
}

By using functional composition, you can easily combine all your advanced logic in one query that will be executed in one transaction. Check out the file src/fauna/queries/fweets.js to see the final result which takes even more advantage of function composition to add rate-limiting, etc. 

Securing your data with UDFs and ABAC roles

The attentive reader will have some thoughts about security by now. We are essentially creating queries in JavaScript and calling these queries from the frontend. What stops a malicious user from altering these queries? 

FaunaDB provides two features that allow us to secure our data: Attribute-Based Access Control (ABAC) and User Defined Functions (UDF). With ABAC, we can control which collections or entities that a specific key or token can access by writing Roles. 

With UDFs, we can push FQL statements to the database by using the CreateFunction(). 

CreateFunction({ 
  name: 'create_fweet', 
  body: <your FQL statement>, 
})

Once the function is in the database as a UDF, where the application can’t alter it anymore, we then call this UDF from the front end.

client.query(
  Call(Function('create_fweet'), message, hashTags)
)

Since the query is now saved on the database (just like a stored procedure), the user can no longer manipulate it. 

One example of how UDFs can be used to secure a call is that we do not pass in the author of the Fweet. The author of the Fweet is derived from the Identity() function instead, which makes it impossible for a user to write a Fweet on someone’s behalf.

Of course, we still have to define that the user has access to call the UDF. For that, we will use a very simple ABAC role that defines a group of role members and their privileges. This role will be named logged_in_role, its membership will include all of the documents in the Accounts collection, and all of these members will be granted the privilege of calling the create_fweet UDF.

CreateRole(
  name: 'logged_in_role', 
  privileges: [
   {
     resource: q.Function('create_fweet'),
     actions: {
       call: true
     }
   }
  ],
  membership: [{ resource: Collection('accounts') }],
)

We now know that these privileges are granted to an account, but how do we ‘become’ an Account? By using the FaunaDB Login() function to authenticate our users as explained in the next section.

How to implement authentication in FaunaDB

We just showed a role that gives Accounts the permissions to call the create_fweets function. But how do we “become” an Account?.

First, we create a new Account document, storing credentials alongside any other data associated with the Account (in this case, the email address and the reference to the User).

return Create(Collection('accounts'), {
  credentials: { password: password },
    data: {
      email: email,
      user: Select(['ref'], Var('user'))
    }
  })
}

We can then call Login() on the Account reference, which retrieves a token.

Login(
 Match( < Account reference > ,
    { password: password }
 )
)

We use this token in the client to impersonate the Account. Since all Accounts are members of the Account collection, this token fulfills the membership requirement of the logged_in_role and is granted access to call the create_fweet UDF.

To bootstrap this whole process, we have two very important roles.

  • bootstrap_role: can only call the login and register UDFs
  • logged_in_role: can call other functions such as create_fweet

The token you received when you ran the setup script is essentially a key created with the bootstrap_role. A client is created with that token in src/fauna/query-manager.js which will only be able to register or login. Once we log in, we use the new token returned from Login() to create a new FaunaDB client which now grants access to other UDF functions such as create_fweet. Logging out means we just revert to the bootstrap token. You can see this process in the src/fauna/query-manager.js, along with more complex role examples in the src/fauna/setup/roles.js file. 

How to implement the session in React

Previously, in the “Creating the front end” section, we mentioned the SessionProvider component. In React, providers belong to a React Context which is a concept to facilitate data sharing between different components. This is ideal for data such as user information that you need everywhere in your application. By inserting the SessionProvider in the HTML early on, we made sure that each component would have access to it. Now, the only thing a component has to do to access the user details is import the context and use React’s ‘useContext’ hook.

import SessionContext from '../context/session'
import React, { useContext } from 'react'

// In your component
const sessionContext = useContext(SessionContext)
const { user } = sessionContext.state

But how does the user end up in the context? When we included the SessionProvider, we passed in a value consisting of the current state and a dispatch function. 

const [state, dispatch] = React.useReducer(sessionReducer, { user: null })
// ...
<SessionProvider value={{ state, dispatch }}>

The state is simply the current state, and the dispatch function is called to modify the context. This dispatch function is actually the core of the context since creating a context only involves calling React.createContext() which will give you access to a Provider and a Consumer.

const SessionContext = React.createContext({})
export const SessionProvider = SessionContext.Provider
export const SessionConsumer = SessionContext.Consumer
export default SessionContext

We can see that the state and dispatch are extracted from something that React calls a reducer (using React.useReducer), so let’s write a reducer.

export const sessionReducer = (state, action) => {
 switch (action.type) {
   case 'login': {
     return { user: action.data.user }
   }
   case 'register': {
     return { user: action.data.user }
   }
   case 'logout': {
     return { user: null }
   }
   default: {
     throw new Error(`Unhandled action type: ${action.type}`)
   }
 }
}

This is the logic that allows you to change the context. In essence, it receives an action and decides how to modify the context given that action. In my case, the action is simply a type with a string. We use this context to keep user information, which means that we call it on a successful login with: 

sessionContext.dispatch({ type: 'login', data: e })

Adding Cloudinary for media 

When we created a Fweet, we did not take into account assets yet. FaunaDB is meant to store application data, not image blobs or video data. However, we can easily store the media on Cloudinary and just keep a link in FaunaDB. The following inserts the Cloudinary script (in app.js):

loadScript('https://widget.cloudinary.com/v2.0/global/all.js')

We then create a Cloudinary Upload Widget (in src/components/uploader.js):

window.cloudinary.createUploadWidget(
  {
    cloudName: process.env.REACT_APP_LOCAL___CLOUDINARY_CLOUDNAME,
    uploadPreset: process.env.REACT_APP_LOCAL___CLOUDINARY_TEMPLATE,
  },
  (error, result) => {
    // ...
  }
)

As mentioned earlier, you need to provide a Cloudinary cloud name and template in the environment variables (.env.local file) to use this feature. Creating a Cloudinary account is free and once you have an account you can grab the cloud name from the dashboard.

You have the option to use API keys as well to secure uploads. In this case, we upload straight from the front end so the upload uses a public template. To add a template or modify it to make it public, click on the gear icon in the top menu, go to Upload tab, and click Add upload preset

You could also edit the ml_default template and just make it public.

Now, we just call widget.open() when our media button is clicked.

const handleUploadClick = () => {
  widget.open()
}
 
return (
  <div>
    <FontAwesomeIcon icon={faImage} onClick={handleUploadClick}></FontAwesomeIcon>
  </div>
)

This provides us with a small media button that will open the Cloudinary Upload Widget when it’s clicked. 

When we create the widget, we can also provide styles and fonts to give it the look and feel of our own application as we did above (in src/components/uploader.js): 

const widget = window.cloudinary.createUploadWidget(
   {
     cloudName: process.env.REACT_APP_LOCAL___CLOUDINARY_CLOUDNAME,
     uploadPreset: process.env.REACT_APP_LOCAL___CLOUDINARY_TEMPLATE,
     styles: {
       palette: {
         window: '#E5E8EB',
         windowBorder: '#4A4A4A',
         tabIcon: '#000000',
         // ...
       },
       fonts: {


Once we have uploaded media to Cloudinary, we receive a bunch of information about the uploaded media, which we then add to the data when we create a Fweet.

We can then simply use the stored id (which Cloudinary refers to as the publicId) with the Cloudinary React library (in src/components/asset.js):

import { Image, Video, Transformation } from 'cloudinary-react'

To show the image in our feed.

<div className="fweet-asset">
  <Image publicId={asset.id} 
    cloudName={cloudName} fetchFormat="auto" quality="auto" secure="true" />
</div>

When you use the id, instead of the direct URL, Cloudinary does a whole range of optimizations to deliver the media in the most optimal format possible. For example when you add a video image as follows:

<div className="fweet-asset">
  <Video playsInline autoPlay loop={true} controls={true} cloudName={cloudName} publicId={publicId}>
    <Transformation width="600" fetchFormat="auto" crop="scale" />
  </Video>
</div>

Cloudinary will automatically scale down the video to a width of 600 pixels and deliver it as a WebM (VP9) to Chrome browsers (482 KB), an MP4 (HEVC) to Safari browsers (520 KB), or an MP4 (H.264) to browsers that support neither format (821 KB). Cloudinary does these optimizations server-side, significantly improving page load time and the overall user experience. 

Retrieving data

We have shown how to add data. Now we still need to retrieve data. Getting the data of our Fwitter feed has many challenges. We need to: 

  • Get fweets from people you follow in a specific order (taking time and popularity into account)
  • Get the author of the fweet to show his profile image and handle
  • Get the statistics to show how many likes, refweets and comments it has
  • Get the comments to list those beneath the fweet. 
  • Get info about whether you already liked, refweeted, or commented on this specific fweet. 
  • If it’s a refweet, get the original fweet. 

This kind of query fetches data from many different collections and requires advanced indexing/sorting, but let’s start off simple. How do we get the Fweets? We start off by getting a reference to the Fweets collection using the Collection() function.

Collection('fweets')

And we wrap that in the Documents() function to get all of the collection’s document references.

Documents(Collection('fweets'))

We then Paginate over these references.

Paginate(Documents(Collection('fweets')))

Paginate() requires some explanation. Before calling Paginate(), we had a query that returned a hypothetical set of data. Paginate() actually materializes that data into pages of entities that we can read. FaunaDB requires that we use this Paginate() function to protect us from writing inefficient queries that retrieve every document from a collection, because in a database built for massive scale, that collection could contain millions of documents. Without the safeguard of Paginate(), that could get very expensive!

Let’s save this partial query in a plain JavaScript variable references that we can continue to build on.

const references = Paginate(Documents(Collection('fweets')))

So far, our query only returns a list of references to our Fweets. To get the actual documents, we do exactly what we would do in JavaScript: map over the list with an anonymous function. In FQL, a Lambda is just an anonymous function.

const fweets = Map(
  references,
  Lambda(['ref'], Get(Var('ref')))
)

This might seem verbose if you’re used to declarative query languages like SQL that declare what you want and let the database figure out how to get it. In contrast, FQL declares both what you want and how you want it which makes it more procedural. Since you’re the one defining how you want your data, and not the query engine, the price and performance impact of your query is predictable. You can exactly determine how many reads this query costs without executing it, which is a significant advantage if your database contains a huge amount of data and is pay-as-you-go. So there might be a learning curve, but it’s well worth it in the money and hassle it will save you. And once you learn how FQL works, you will find that queries read just like regular code. 

Let’s prepare our query to be extended easily by introducing Let. Let will allow us to bind variables and reuse them immediately in the next variable binding, which allows you to structure your query more elegantly.

const fweets = Map(
 references,
 Lambda(
   ['ref'],
   Let(
     {
       fweet: Get(Var('ref'))
     },
     // Just return the fweet for now
     Var('fweet')
   )
 )
)

Now that we have this structure, getting extra data is easy. So let’s get the author.

const fweets = Map(
 references,
 Lambda(
   ['ref'],
   Let(
     {
       fweet: Get(Var('ref')),
       author: Get(Select(['data', 'author'], Var('fweet')))
     },
     { fweet: Var('fweet'), author: Var('user') }
   )
 )
)

Although we did not write a join, we have just joined Users (the author) with the Fweets. We’ll expand on these building blocks even further in a follow up article. Meanwhile, browse src/fauna/queries/fweets.js to view the final query and several more examples. 

More in the code base

If you haven’t already, please open the code base for this Fwitter example app. You will find a plethora of well-commented examples we haven’t explored here, but will in future articles. This section touches on a few files we think you should check out.

First, check out the src/fauna/queries/fweets.js file for examples of how to do complex matching and sorting with FaunaDB’s indexes (the indexes are created in src/fauna/setup/fweets.js). We implemented three different access patterns to get Fweets by popularity and time, by handle, and by tag.

Getting Fweets by popularity and time is a particularly interesting access pattern because it actually sorts the Fweets by a sort of decaying popularity based on users’ interactions with each other. 

Also, check out src/fauna/queries/search.js, where we’ve implemented autocomplete based on FaunaDB indexes and index bindings to search for authors and tags. Since FaunaDB can index over multiple collections, we can write one index that supports an autocomplete type of search on both Users and Tags.

We’ve implemented these examples because the combination of flexible and powerful indexes with relations is rare for scalable distributed databases. Databases that lack relations and flexible indexes require you to know in advance how your data will be accessed and you will run into problems when your business logic needs to change to accommodate your clients’ evolving use cases.

In FaunaDB, if you did not foresee a specific way that you’d like to access your data, no worries — just add an Index! We have range indexes, term indexes, and composite indexes that can be specified whenever you want without having to code around eventual consistency. 

A preview of what’s to come 

As mentioned in the introduction, we’re introducing this Fwitter app to demonstrate complex, real-world use cases. That said, a few features are still missing and will be covered in future articles, including streaming, pagination, benchmarks, and a more advanced security model with short-lived tokens, JWT tokens, single sign-on (possibly using a service like Auth0), IP-based rate limiting (with Cloudflare workers), e-mail verification (with a service like SendGrid), and HttpOnly cookies.

The end result will be a stack that relies on services and serverless functions which is very similar to a dynamic JAMstack app, minus the static site generator. Stay tuned for the follow-up articles and make sure to subscribe to the Fauna blog and monitor CSS-Tricks for more FaunaDB-related articles. 

The post Rethinking Twitter as a Serverless App appeared first on CSS-Tricks.

How to Build a Twitter Bot With Node.js

How to Build a Twitter Bot With Node.js

Building a Twitter bot using Twitter's API is one of the fundamental applications of the Twitter API. To build a Twitter bot with Nodejs, you’ll need to take these steps below before proceeding:

  1. Create a new account for the bot
  2. Apply for API access at developer.twitter.com
  3. Ensure you have Node.js and NPM installed on your machine

We’ll be building a Twitter bot with Nodejs to track a specific hashtag then like and retweet every post containing that hashtag.

How to Display Recent Tweets in WordPress (Step by Step)

Do you want to display your recent tweets in WordPress?

Integrating X/Twitter with your WordPress website helps increase user engagement. Your blog visitors can easily discover your tweets, which can also help you get new followers on Twitter.

In this article, we will show you how to display recent tweets in WordPress.

How to Display Recent Tweets in WordPress

Why Display Recent Tweets on Your WordPress Site?

X/Twitter is one of the most popular social media platforms on the market. Displaying recent tweets on your WordPress website can enhance your online presence and engagement in several ways.

For starters, when users visit your website and see your social media feed, they might be intrigued enough to click through to your Twitter account and follow you, increasing your reach.

Plus, tweets can serve as a real-time update about what’s happening on your website or company. This can encourage engagement among your audience, as they can interact with your tweets directly.

Recent tweets can also act as social proof on your WordPress site. You can retweet positive reviews or people recommending your products, helping build trust with subscribers or customers.

With this in mind, let’s look at the different methods of displaying recent tweets on your WordPress website. You can use the quick links below to skip to a specific method:

Method 1: Manually Embed Tweets in the Gutenberg Block Editor (No Plugin)

The first method to display your recent tweets in WordPress is by manually embedding your Twitter profile or timeline on your WordPress page, post, or widget (for classic theme users).

Just like adding a YouTube video, WordPress makes it easy to embed Twitter content like a single tweet or a timeline. Its oEmbed feature can automatically turn a content URL into an embed code when pasted into the block editor.

First, you need to find and copy the URL of the Twitter profile or tweet that you want to embed.

For example, the Twitter profile URL of WPBeginner is https://twitter.com/wpbeginner

Meanwhile, the URL of a single tweet looks like this: https://twitter.com/wpbeginner/status/1604852592827326464

Next, just follow one of the methods below:

Displaying Recent Tweets in a WordPress Post or Page

First, log into your WordPress dashboard and open the block editor for a WordPress post or page.

If you want to create a new post or page, you can do this by going to Posts/Pages » Add New.

Clicking Add New Page in WordPress admin area

Then, simply paste the Twitter profile URL that you copied earlier in the ‘Type / to choose a block’ area.

You can see this highlighted below.

Pasting a Twitter URL to the block editor

Once you’ve done that, the block will immediately turn into a Twitter timeline block showing recent Tweets from that particular account.

In the block settings sidebar, you can choose to resize the block for smaller devices to make it more responsive for mobile viewing.

Additionally, feel free to add more blocks to the page or post to encourage users to follow your Twitter account.

Once done, simply click ‘Update’ or ‘Publish’ to make the changes live.

Publishing a page with a Twitter Feed

This method adds your recent tweets inside a box with a vertical slider. The box includes the 20 most recent tweets and the ‘View more on Twitter’ button at the end.

Here is what our Twitter timeline looks like:

An example of a page with a Twitter Feed made with the built-in Twitter block

If you use a WordPress block theme, then you can also use this same method to embed a Twitter feed in the Full Site Editor and display recent tweets in a pattern or template part.

You can learn more about this in our complete guide to WordPress Full Site Editing.

Displaying Recent Tweets in a WordPress Widget Area

If you use a classic WordPress theme and want to display your latest tweets in a widget area (like a sidebar), then just follow these steps.

First, go to Appearance » Widgets. Then, click the ‘+ Add New’ button in your selected widget area and select the Twitter widget.

Adding a Twitter widget in WordPress

From here, just paste the Twitter account or post URL in the appropriate field.

Then, click ‘Embed.’

Embedding a Twitter profile in a WordPress widget area

You can then update your widgets and preview the Tweets widget live on your site.

Here’s how the timeline appears in our WordPress sidebar:

Example of a Twitter widget in a WordPress sidebar

The second method to add recent tweets to your WordPress site is with a Twitter plugin. The reason why we recommend this method is that it offers a lot more customization options than the previous method, allowing you to adjust the feed to your page design.

For this, we will use Smash Balloon Custom Twitter Feeds. This plugin helps to create beautiful social feeds of different types. You can show tweets based on hashtags, search terms, mentions, timelines, and more.

Note: While there is a free Custom Twitter Feeds plugin, this article will use the Custom Twitter Feeds Pro version. It comes with much more advanced features like timeline filtering and combining multiple Twitter feeds into one.

You will first need to install and activate the WordPress plugin. Once it’s active, go to your WordPress admin area, navigate to Twitter Feed » Settings, and paste your license key into the appropriate field.

After that, you need to activate the license and click ‘Save Changes.’

Activating Smash Balloon's Custom Twitter Feeds Pro license key

Now, just go to Twitter Feed » All Feeds.

Then, click the ‘+ Add New’ button.

Adding a new Twitter Feed with Smash Balloon

If this is your first time adding a Twitter feed using Smash Balloon, then you will be asked to verify your email address.

Just go ahead and click the ‘Connect’ button to do that and follow the on-screen instructions.

Connecting the user's email address with Smash Balloon

Once you are done, you will return to the Custom Twitter Feeds plugin page and be asked to select a feed type.

With Custom Twitter Feeds, you can choose to embed a user timeline feed, a hashtag feed, or a search feed. For the sake of this example, we will use the first option. Once you’ve made your choice, just click ‘Next.’

Creating a User Timeline Twitter Feed with Smash Balloon

On the next screen, you can type in the Twitter handle you want to embed on your WordPress website.

After that, click ‘Next’ again.

Choosing a Twitter Feed source in Smash Balloon

Let’s now pick a Twitter feed template. There are 7 to choose from, and you can always change it later if you don’t think it suits your page design.

After you have made your choice, go ahead and click ‘Next.’

Choosing a Smash Balloon Twitter Feed template

At this stage, you should arrive at the Twitter feed editing interface. You will see a live preview on the right side of the page and a left-hand panel where you can configure how the feed looks.

There are two tabs: ‘Customize’ and ‘Settings.’

The Twitter Feed editing interface in Smash Balloon

Let’s start with Customize. If you choose the ‘Feed Layout’ option, then you can pick between the available feed layouts (like list, masonry, or carousel) set the number of tweets to display, tweak the feed height, and so on.

Note: Because of API limitations, Smash Balloon can only display 1 to 30 tweets at first, but more will accumulate over time.

Once you are done with those settings, simply click the ‘Customize’ button at the top to go back to the main menu.

Customizing the Twitter Feed layout in Smash Balloon

Another thing you can do is enable the Load More button, which will appear below your displayed tweets. It’s a handy feature if you have tons of tweets but cannot show them all on the same page.

Just click the ‘Load More Button’ option, followed by the ‘Enable’ button. After that, you can customize the button’s appearance.

Customizing the Twitter Feed Load More Button in Smash Balloon

If you switch to the ‘Settings’ tab, then you can see options to add more feed sources, apply tweet filters, and use advanced features (like adding custom CSS).

You can also click the ‘Clear Feed Cache’ button to remove the previous feed cache. The next time the plugin needs to display your Twitter feed, it will have to retrieve the latest tweets from X/Twitter’s servers instead of using the old cached data.

Customizing the Twitter Feed settings in Smash Balloon

Let’s try adding filters to your tweets by clicking the ‘Filters’ option.

Here, you can choose to include replies and retweets, show tweets based on which words are allowed or blocked, or hide specific tweets.

Customizing the filters to display the Twitter Feed in Smash Balloon

Once you are happy with how the Twitter Feed looks, you can click the ‘Save’ button.

To add the Twitter Feed to your page or widget area, just click on the ‘Embed’ button at the top-right corner.

After that, a popup will appear, showing you how to display the Twitter Feed: with a shortcode, a block, or a widget.

The Twitter Embed Feed popup in Smash Balloon

Regardless of the method you choose, the first thing you need to do is copy the shortcode because you will need it.

Then, if you want to embed the Twitter feed on a page, click the ‘+ Add to a Page’ button.

Once you do that, you can select an existing page from your WordPress website and click ‘Add.’

Selecting a page to embed the Twitter Feed in using Smash Balloon

You will then be directed to the WordPress block editor of your chosen page.

Click the ‘+’ add block button anywhere on the page and select the Twitter Feed block.

Selecting the Smash Balloon Twitter Feed block in the block editor

Now, the Twitter Feed you created earlier may not show up right away.

If this happens to you, just paste the shortcode into the ‘Shortcode Settings’ field in the block settings sidebar.

After that, click ‘Apply Changes.’

Inserting a shortcode in the Smash Balloon Twitter Feed block

Once done, you can go ahead and click ‘Update’ to make the changes live.

Here is what the Twitter Feed looks like on our demo site:

An example of the Twitter Feed made with Smash Balloon

If you want to display your Twitter Feed in a widget area, then just click the ‘+ Add to a Widget’ option. You will be redirected to the widget editor next.

Then, simply find and select the ‘Twitter Feed’ widget.

Adding the Twitter Feed Smash Balloon widget in the widget editor

Similar to the previous method, just paste the shortcode in the block settings sidebar and click ‘Apply Changes.’

You will then see your newly created Twitter Feed in the live preview.

Inserting the Smash Balloon Twitter Feed shortcode in the widget editor

Finally, click ‘Update’ to make the changes final.

You can then visit your live website to see what the feed looks like:

Example of the Twitter Feed widget made with Smash Balloon

Method 3: Display Latest Tweets in WordPress With Twitter Publish (No Plugin)

The last method lets you add recent Twitter posts using the Twitter Publish feature.

Twitter Publish lets you easily create the embed code for various types of Twitter content, including a tweet, a video, a timeline, or a button (like a Follow or Share button).

This method allows you to customize how the embedded element looks before adding it to your WordPress blog or website. It’s not as powerful as the second method, but it’s worth mentioning because it’s free.

For this tutorial, we will show you how to use Twitter Publish to embed a timeline. First, you need to visit the Twitter Publish website and then paste your Twitter profile URL into the ‘What would you like to embed?’ box.

Once that’s done, click on the arrow icon.

Inserting a Twitter URL in the Twitter Publish website

After that, you will be asked to choose a display option: Embedded Timeline or X/Twitter Buttons.

You should choose the ‘Embedded Timeline’ option, as you want to show your Twitter timeline with recent tweets.

Twitter Publish's display options

Upon selecting the display option, it will instantly create the embed code for your recent tweets. You can go ahead and click ‘Copy Code’ to embed the custom HTML code right away.

Alternatively, click ‘Set customization options’ to customize how the embedded timeline looks.

Customizing the Twitter Feed made with Twitter Publish

Here, you can customize the timeline’s height and width, choose a light or dark mode, and enable a language translation for the tweets if needed.

You can see what the embedded element will look like below the settings. Once done, just click ‘Update.’

Clicking Update in the Twitter Publish website

The embed code will now include the customization settings you have chosen for the timeline.

Simply click ‘Copy Code’ to continue.

Copying a Twitter Publish embed code

Now, go back to your WordPress dashboard and open the block editor for a page, post, or widget area.

After that, just click the ‘+’ add block button anywhere in the editor and select the Custom HTML widget or block.

Selecting the Custom HTML block in the block editor

Now, go ahead and paste the embed code from earlier in the field.

Once done, you can click the ‘Preview’ button to see what the feed looks like.

Pasting the Twitter Publish HTML code in the block editor

After that, feel free to add more elements to the page, post, or widget area. Then, just update or publish it.

Here’s what our demo website looks like:

An example of Twitter Feed made with the Twitter Publish website

Bonus Tip: Add More Social Media Feeds to WordPress

Do you run other social media platforms for your brand or business? If so, then you might want to display other social feeds besides Twitter on your website.

By displaying different social feeds on your WordPress site, you can let visitors know what platforms they can follow you on, increasing your follower count.

Showing off your social feeds also has a key advantage over displaying the usual social icon buttons. It can show visitors what content they would miss by not following you on your social networks, creating a ‘fear of missing out.’

With Smash Balloon, you can display and customize all kinds of social media feeds on your WordPress website. This way, all of the feeds look good with the theme you are using.

Customize TikTok feed layout

Just check out the tutorials below on how to display different social feeds in WordPress:

We hope this article helped you to learn how to show recent tweets in WordPress. You may also want to see our ultimate guide to WordPress SEO (search engine optimization) or our expert pick of the best WordPress social media plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Display Recent Tweets in WordPress (Step by Step) first appeared on WPBeginner.

How to Track your Study Time with Google Forms and Sheets

In most organizations, employees are required to fill timesheets every week so the company can track the amount of time that people have spent working on various projects and tasks.

My kids are in middle/high school and I’ve been looking for a timesheet-style solution that would help me understand their studying patterns and learn how much time they spend on various subjects.

There are quite a few apps available for time tracking but I was looking for something simple and Google Forms fit the bill perfectly. The multiple-choice grid question is handy for quickly marking the time that they have spent on various subjects. I also added a Linear scale question for them to self-evaluate their daily screen time on a relative scale.

Here’s how the final study log form looks like:

Student Study Logs

The Email Form Notifications add-on is enabled for this Google Form so parents get an instant email when the boys submit the study log form. The email contains all the form answers in a neatly formatted table. An instant push notification is sent on the mobile phone as well with IFTTT.

Google Forms write all the form responses in a Google Spreadsheet and that makes it even easier to analyze the study pattern visually. You can use one of the available charts or hit the “Explore” button in Google Sheets and ask questions in natural English about the answers stored in your spreadsheet.

For instance, you can say “Sum of Subjects [Physics] by Name last week” and it will instantly tell you the amount of time that each kid has spent on that subject last week. Or say “What percentage of Subjects [Physics] is not empty where name is Aryaman” to know the percentage of days when he touched a particular subject.

Google Sheets Charts

And because Google Forms work just fine on mobile devices, students can quickly fill the time log anywhere as long as they know the form’s URL.

The post How to Track your Study Time with Google Forms and Sheets appeared first on Digital Inspiration.