Site logo

Archived topic

Caption styling broken after update to WordPress 5.3

10 replies · Started by Steven on November 14, 2019

Viewing posts 1–11 of 11

Hi

Immediately following the last update to WordPress, the styling of the captions on my site broke. I am currently using Generatepress Pro with Elementor Pro, but the problem persists whether I have elemector installed or not. I have tried clearing my cache, disabling all plugins, etc and still no change. I tried installing some other themes (Hello, Astra, Ocean WP) and the caption styling seems fine with those. Any ideas?

(I have disabled my caching plugin)

Hi there,

It seems Gutenberg moved their caption CSS into the optional additional stylesheet that isn't loaded by default.

Give this function a shot:

add_action( 'after_setup_theme', function() {
    add_theme_support( 'wp-block-styles' );
} );

Let me know :)

Thanks Tom. That looks much better!

Hi Tom, where do I insert the code that you have mentioned above? Sorry I'm a bit new to this and would need guidance.

Hello David,

I'm not for installing any new plugins like Simple CSS, so if you can tell me exactly where I need to paste this code in the "Additional CSS" tab of the "Customize" option, I would be glad. I'd request you to give me the exact location where I need to paste the code which Tom has mentioned above -

add_action( 'after_setup_theme', function() {
add_theme_support( 'wp-block-styles' );
} );

That code is PHP so it cannot be in the Additional CSS field in the customizer.

It would need to be one of these methods:
https://docs.generatepress.com/article/adding-php/

Code Snippets plugin is the easiest way and should have minimal impact on your site.

If not then Child theme's function.php is the only other solution.

Hello Leo, can I place that text anywhere in the functions.php file from within the Wordpress 'Theme Editor' option?

No. It's not a good idea to add any code to the theme's core files.

It will get erased during updates.

Thank you, this issue is resolved. In the subject of captions, can you please provide me a simple way to increase the size of the image caption site-wide? I wish to increase the size of all image captions (past and future) by 1 size.

Please open a new topic for your question as it's not related to the original post/topic and this is not your topic.

I'm happy to provide the code once you do :)

This archived topic is closed to new replies.