Docs    Facebook    Customizations

Changing the font in your Facebook feed & using Google Fonts

The feed inherits your theme font by default. How to set a different font, including a Google Font, with custom CSS.

Would you like to change the font in your Facebook feed or use a Google Font?

The plugin is designed to inherit the font your website or WordPress theme uses, so the feed fits into your site. If you want a different font, you can set one with a short piece of CSS. We will also cover what to do when the feed does not pick up your theme’s font.

Before you get started, make sure Custom Facebook Feed is installed and activated on your site.

Here is what we will cover.

Changing the Font in Your Feed

To get started, we will add one CSS rule that sets the font for the whole feed. The feed sits inside a wrapper with the ID cff. A rule that starts with #cff reaches everything in it.

Here is the code you will add. Replace sans-serif with the font you want to use.

#cff{ font-family: sans-serif; }
  1. In your WordPress dashboard, go to Appearance » Customize.
  2. Next, click Additional CSS.
  3. Next, paste the code above into the box.
  4. Then click Publish to save your CSS.

Additional CSS is the default place for this code. You can also add it to your theme’s stylesheet or another custom CSS location you already use.

Older versions of the plugin had their own Custom CSS field. That field is deprecated. If you saved CSS there before, the plugin shows it as read-only text in a Custom CSS box on the Feeds tab of the Facebook Feed » Settings page. The box carries a notice that your CSS has been moved into the WordPress Additional CSS field. Add any new CSS to Additional CSS instead.

The plugin moves your old CSS only once, and only when it passes the plugin’s check. If it was moved, you will find it in Additional CSS.

If you want to load a font from Google, the next section shows how.

Using Google Fonts in Your Feed

Google Fonts is a free library of fonts. To use one in your feed, you add two pieces of CSS to the same Additional CSS box. The first loads the font from Google. The second tells the feed to use it.

  1. To start, go to Google Fonts and select the font you want to use.
  2. Next, find the embed code for your font and select the @import option. Then copy the @import line. If the web address in it starts with http://, change it to https://.
  3. In your WordPress dashboard, go to Appearance » Customize and click Additional CSS. Then paste the @import line into the box.
  4. Back on Google Fonts, copy the font-family code for your font. Then paste it into a #cff rule under the @import line, as in the example below.
  5. Next, click Publish to save your CSS.

Here is the entire code for the Open Sans font. Open Sans is only an example. In your own CSS, use the name of the font you chose.

@import url(https://fonts.googleapis.com/css?family=Open+Sans);
#cff{ font-family: 'Open Sans', sans-serif; }

If your feed still shows a different font, the next section covers the most common cause.

The Font in My Facebook Feed Isn’t Inherited From My Website

By default, your Facebook feed inherits the font from your website. If it does not, something in your theme may be preventing it.

We have run into this before when <code> tags are added into the feed’s HTML. Your theme, another plugin, or the shortcode itself being wrapped in code tags in your page editor can add them.

To fix this, check the shortcode first. Here is what a shortcode wrapped in code tags looks like.

<code>[custom-facebook-feed]</code>
  1. Open the page or post that shows your feed in the classic editor. Then click the Text tab in the top right of the editor box. Next, check whether the shortcode is wrapped in <code> tags, as in the example above.
  2. If it is, remove the code tags so only the shortcode is left. In the block editor, the shortcode goes in a Shortcode block. To see how, read our guide on displaying your Facebook feed on a page, post or widget.

If this does not solve the problem, add the following CSS to Additional CSS the same way as in the first section. Then replace sans-serif with the font your theme uses.

#cff code { font-family: sans-serif; }

If you would rather set a Google Font on your feed, follow the steps in Using Google Fonts in Your Feed.

That’s it! Your feed now uses the font you chose, and you know how to fix a feed that does not inherit your theme’s font. To style your feed further with CSS, see our guide on custom snippets for Facebook Feed.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about changing the font in your Facebook feed.

Where do I add the CSS for my feed’s font?

The default place is Additional CSS, found at Appearance » Customize » Additional CSS in your WordPress dashboard. For the steps and the other places you can use, see the Changing the Font in Your Feed section above.

Can I still use the plugin’s own Custom CSS box?

No. The Custom CSS field is deprecated. The box shows on the Feeds tab of the Settings page only when CSS was saved there earlier, and it is read-only. To check where your old CSS went, see the Changing the Font in Your Feed section above.

What does #cff mean in the CSS?

It is the ID of the wrapper around the whole feed. A rule that starts with #cff applies to everything inside the feed. Both the free and the paid version of Custom Facebook Feed use the same wrapper ID.

support

Couldn’t find your answer in the docs?

Contact Support