Elementor Font Settings Not Working? Resolving Gutenberg Conflicts

When building websites with WordPress, many people choose Elementor as a page design tool and also use it for post content. Gutenberg Editor. Many of you will have encountered a headache: font styles set in Elementor are not synchronized with paragraphs or headings created in Gutenberg. This is quite common, especially if the theme is not specific to the Gutenberg and Elementor Do a good job of adapting the case.

Image[1]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts

root cause

This problem usually arises in the following situations:

  • Gutenberg uses a separate CSS stylesheet, which takes precedence.
  • The theme or plugin is Gutenberg Provides additional styling support that overrides Elementor's settings.
  • Elementor's global styles only take effect in the area rendered by Elementor, whereas the post body is usually rendered under the control of the WordPress theme.

cure

1. Use Elementor to control the style of the whole article.

If your post page was created using an Elementor template, try adding the "Post Content" widget to Elementor and adjusting the fonts in its style settings. This will have a direct impact on Gutenberg ContentThe presentation of the

Operational Steps:

  • Elementor > Templates > Theme Builder.
Image [2]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts
  • Add a "Single Piece" Template (Single Post).
Image [3]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts
  • Open the Elementor editor and find the "Post Content" widget.
  • Drag it into your post template.
Image [4]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts
  • In the style settings, adjust the "Typography" options, such as font, size, line height, etc.
Image [5]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts
  • Updates are saved and the front-end page is refreshed.

2. Add custom CSS

If you're using the theme's default post layout, it's recommended to add a piece of CSS that applies Elementor's font styles to Gutenberg's paragraph and heading elements.

.entry-content p,
.entry-content h1, .
.entry-content h2, .
.entry-content h3, .
.entry-content h4, .
.entry-content h5, .entry-content h6 { .entry-content h7, .entry-content h8
.entry-content h6 {
  font-family: var(--e-global-typography-text-font-family); font-weight: var(--e-global-typography-text-font-family)
  font-weight: var(--e-global-typography-text-font-weight);
  font-size: var(--e-global-typography-text-font-size);
}
Image [6]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts

This code assumes that you have already set theglobal fontVariables. You can check if these variables exist in Site Settings > Typography.

Image [7]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts

3. Check if the theme is injected with Gutenberg styles.

Some topics (such as Astra,Blocksy) actively loads Gutenberg's editor styles on the front-end, which affects the visual consistency of the page. You can find out if there is an option to turn off Gutenberg style loading in your theme settings. Procedure:

  • Refresh the page to find out if the wp-block-library.css or similarly named files loaded
  • Open your browser's developer tools (press F12 maybe Ctrl+Shift+I)
  • Switch to the "Network" tab.
Image [8]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts

If you can't find the corresponding settings, try disabling these styles with the following code:

add_action( 'wp_enqueue_scripts', function() {
  wp_dequeue_style( 'wp-block-library' );
}, 100 );

Add the above code to the child theme's functions.php Documentation.

Image [9]-Elementor Font Settings Not Working? Resolving Gutenberg Conflicts

wrap-up

Gutenberg and Elementor The issue of style conflicts is a matter of "who controls the front-end output". If you want to Elementor If you want to take control of the global style, then let the content of the article also enter the jurisdiction of Elementor; otherwise, you have to use CSS to manually strengthen. Remember to test whether the font before and after the uniformity, do not just look at the effect in the editor, the front-end page performance is the most critical.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by Little Lin
THE END
If you like it, support it.
kudos2894 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments