Docs    Facebook    Customizations

Using Custom CSS code in our plugins

Where to add custom CSS for a Smash Balloon feed, using the WordPress Customizer so you can preview changes as you make them.

Would you like to add your own CSS to change how your Smash Balloon feed looks?

WordPress has a built-in place for custom CSS called Additional CSS. It works with our feed plugins, so you don’t need a CSS box inside the plugin. This guide shows where to add your CSS, and how to move code saved in the older Custom CSS box of Facebook Feed or Instagram Feed.

Before you get started, the Smash Balloon plugin you want to style must be installed and activated on your WordPress site.

Adding Custom CSS in WordPress

To get started, we’ll add your CSS in the WordPress Customizer.

The WordPress Customizer lets you add CSS and shows a live preview of your changes. If your site uses a block theme, use the steps in the next section instead.

  1. First, go to Appearance » Customize in your WordPress dashboard. This opens the WordPress Customizer, with a live preview of your site.
  2. Next, in the left pane, click Additional CSS. The WordPress Customizer left pane with the Additional CSS section highlighted by a red box
  3. Then, type or paste your CSS into the box. A valid rule shows up in the live preview right away. You can keep adding CSS until you like how your site looks. The Additional CSS box in the Customizer with a CSS rule typed in and a red box around the code area
  4. Finally, when you are done, click Publish at the top. The blue Publish button at the top of the Customizer pane, marked with a red arrow

Each feed’s posts sit inside a wrapper with its own ID, so you can start a rule with that ID to style the feed and nothing else on the page. Facebook Feed uses #cff and Instagram Feed uses #sb_instagram. Here is an example that gives each feed a light grey background.

#cff { background-color: #f5f5f5; }
#sb_instagram { background-color: #f5f5f5; }

Additional CSS belongs to the theme you are using when you save it. Before you switch to another theme, copy your CSS so you can paste it into the new theme’s Additional CSS box in the same way.

Adding Custom CSS in a Block Theme

A block theme uses the Site Editor instead of the Customizer. In the Site Editor, WordPress puts site-wide CSS in the Styles panel, as WordPress explains in its Styles guide.

  1. First, go to Appearance » Editor in your WordPress dashboard.
  2. Next, click the half-shaded circle icon at the top right of the screen to open the Styles panel. The top right of the WordPress Site Editor with a red box around the half-shaded circle Styles icon
  3. Then, click the three dot menu and select Additional CSS. The Styles panel three dot menu open in the Site Editor with a red box around Additional CSS
  4. Finally, add your CSS to the box and save your changes.

WordPress applies CSS you add here across your whole site. Your CSS stays when your theme updates. WordPress clears it when you switch to a different theme. Before you switch themes, copy your CSS so you can add it again after the switch.

Moving CSS From the Old Custom CSS Box

Facebook Feed and Instagram Feed also have an older Custom CSS box of their own on the Settings page. Each plugin treats that box in its own way. Find your plugin below to see the steps for it.

Facebook Feed

The Custom CSS box was deprecated in version 4.0.2 of the free plugin and in version 4.0.7 of Facebook Feed Pro. After that update, the plugin moved your CSS into Additional CSS. It added the CSS to the theme that was active at that time. The CSS sits between the comment lines /* Custom Facebook Feed */ and /* Custom Facebook Feed - End */. When the CSS contains anything that looks like an HTML tag, the plugin keeps it in the old box instead of moving it.

To see whether you have old CSS, look for the box on the Settings page.

  1. First, go to Facebook Feed » Settings in your WordPress dashboard and click the Feeds tab.
  2. Next, look for the Custom CSS box. It only shows when CSS was saved there before. If the box isn’t there, you have no old CSS to move.

The box shows your old CSS in a read-only field, under this message from the plugin.

The Custom CSS field has been deprecated. Your CSS has been moved into the native WordPress Custom CSS field instead. This is located here at Appearance > Customize > Additional CSS.

The plugin shows this same message whether it moved your CSS or kept it in the box. To see where your CSS is, open Additional CSS in the Customizer, the place the message names, and look for the /* Custom Facebook Feed */ line. If your CSS isn’t there, move it yourself.

  1. First, in the Custom CSS box on the Feeds tab, select the CSS in the read-only field and copy it.
  2. Next, open Additional CSS, using the steps in Adding Custom CSS in WordPress or Adding Custom CSS in a Block Theme.
  3. Then, paste your CSS into the box. If it has HTML tags such as <style> and </style>, delete the tags and keep the CSS rules between them.
  4. Finally, publish or save your changes.

Instagram Feed Pro handles the old box differently. The next section covers it.

Instagram Feed Pro

The Custom CSS and Custom JS boxes have been deprecated since version 6.5.0. In Instagram Feed Pro, the plugin still adds any CSS saved in the Custom CSS box to your pages until you move it.

  1. First, go to Instagram Feed » Settings in your WordPress dashboard and click the Feeds tab.
  2. Next, look for the notice titled DEPRECATED. It only shows when CSS or JavaScript was saved in the plugin before. If the notice isn’t there, you have nothing to move.

The notice reads as follows.

The use of Custom CSS and Custom JS has been deprecated. Please use the free WP Code Plugin to add custom CSS. All your custom CSS and JavaScript will be seamlessly moved to a snippet with just one click.

The notice has one button. It reads One-click Install and Migrate when WPCode isn’t installed. It reads One-click Activate and Migrate when WPCode is installed but not activated. It reads One-click Migrate when WPCode is active. WPCode is a separate plugin that adds your own code to your site. When you use the button, the plugin saves your CSS in a WPCode snippet called Instagram Feed Custom CSS. It saves your JavaScript in one called Instagram Feed Custom JS. It then empties the old boxes.

For an example of how WPCode works, see our guide to moving custom JavaScript code out of our plugins.

If you are not sure which way to go, the button is the quickest choice. It moves your CSS and JavaScript in one click.

If you would rather use Additional CSS, move the CSS by hand. The Custom CSS box is still an ordinary text box here.

  1. First, copy the CSS from the Custom CSS box on the Feeds tab.
  2. Next, paste it into Additional CSS, using the steps in Adding Custom CSS in WordPress or Adding Custom CSS in a Block Theme.
  3. Then, go back to the Feeds tab and delete the CSS from the Custom CSS box, so the same rules aren’t added twice.
  4. Finally, click Save Changes.

The free Instagram Feed plugin works a little differently. The next section explains how.

Instagram Feed (free)

The Custom CSS box is still on the Feeds tab of Instagram Feed » Settings in the free plugin. CSS saved there still loads on your pages. You can keep using it. If you want your CSS in one place, use the same copy and delete steps shown for Instagram Feed Pro above.

That’s it! You now know how to add custom CSS to your Smash Balloon feeds. For ready-made CSS you can copy, see our Facebook Feed custom snippets guide.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about custom CSS in our plugins.

Will my CSS still work if I switch themes?

Not automatically. Additional CSS belongs to the theme you were using when you saved it. Before you switch themes, copy your CSS so you can paste it into the new theme’s Additional CSS box. In a block theme, WordPress clears the CSS you added in the Site Editor when you switch themes.

I can’t find the Custom CSS box in my Facebook Feed settings. Where did it go?

The box only shows when CSS was saved in it before. If the Feeds tab has no Custom CSS box, you have no old CSS in the plugin. New CSS belongs in Additional CSS.

Can I still edit the CSS in the Facebook Feed Custom CSS box?

No. The field is read-only. To change it, copy your CSS from it into Additional CSS and edit it there.

Facebook Feed said it moved my CSS, but I can’t find it in Additional CSS. Why?

The plugin keeps CSS that contains anything that looks like an HTML tag in the old box instead of moving it. If it did move your CSS, it added it to the Customizer’s Additional CSS for the theme that was active at that time. The CSS sits between the comment lines /* Custom Facebook Feed */ and /* Custom Facebook Feed – End */. If you changed themes since then, check the previous theme. You can also copy your CSS from the read-only field and paste it into Additional CSS, as shown in the Facebook Feed section above.

Which selector do I use to style a feed?

Facebook Feed uses #cff and Instagram Feed uses #sb_instagram. Each is the ID of the wrapper that holds the feed’s posts.

support

Couldn’t find your answer in the docs?

Contact Support